1 '\" te
   2 .\" Copyright (c) 2013 Gary Mills
   3 .\"  Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
   4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   7 .TH W 1 "Dec 15, 2013"
   8 .SH NAME
   9 w \- display information about currently logged-in users
  10 .SH SYNOPSIS
  11 .LP
  12 .nf
  13 \fBw\fR [\fB-hlsuw\fR] [\fIuser\fR]
  14 .fi
  15 
  16 .SH DESCRIPTION
  17 .sp
  18 .LP
  19 The \fBw\fR command displays a summary of the current activity on the system,
  20 including what each user is doing. The heading line shows the current time, the
  21 length of time the system has been up, the number of users logged into the
  22 system, and the average number of jobs in the run queue over the last 1, 5 and
  23 15 minutes.
  24 .sp
  25 .LP
  26 The fields displayed are: the user's login name,
  27 the name of the tty the user is on,
  28 the time of day the user logged on (in ISO time format, weekday name
  29 and \fIhours:minutes\fR, or ISO date format), the idle
  30 time\(emthat is, the number of minutes since the user last typed anything
  31 (in \fIhours:minutes:seconds\fR),
  32 the \fBCPU\fR time used by all processes and their
  33 children on that terminal (in \fIhours:minutes:seconds\fR),
  34 the \fBCPU\fR time used
  35 by the currently active processes (in \fIhours:minutes:seconds\fR),
  36 and the name and
  37 arguments of the current process.
  38 .SH OPTIONS
  39 .sp
  40 .LP
  41 The following options are supported:
  42 .sp
  43 .ne 2
  44 .na
  45 \fB\fB-h\fR\fR
  46 .ad
  47 .RS 6n
  48 Suppresses the heading.
  49 .RE
  50 
  51 .sp
  52 .ne 2
  53 .na
  54 \fB\fB-l\fR\fR
  55 .ad
  56 .RS 6n
  57 Produces a long form of output, which is the default.
  58 .RE
  59 
  60 .sp
  61 .ne 2
  62 .na
  63 \fB\fB-s\fR\fR
  64 .ad
  65 .RS 6n
  66 Produces a short form of output. In the short form, the tty is abbreviated, the
  67 login time and \fBCPU\fR times are left off, as are the arguments to commands.
  68 .RE
  69 
  70 .sp
  71 .ne 2
  72 .na
  73 \fB\fB-u\fR\fR
  74 .ad
  75 .RS 6n
  76 Produces the heading line which shows the current time, the length of time the
  77 system has been up, the number of users logged into the system, and the average
  78 number of jobs in the run queue over the last 1, 5 and 15 minutes.
  79 .RE
  80 
  81 .sp
  82 .ne 2
  83 .na
  84 \fB\fB-w\fR\fR
  85 .ad
  86 .RS 6n
  87 Produces a long form of output, which is also the same as the default.
  88 .RE
  89 
  90 .SH OPERANDS
  91 .sp
  92 .ne 2
  93 .na
  94 \fB\fIuser\fR\fR
  95 .ad
  96 .RS 8n
  97 Name of a particular user for whom login information is displayed. If
  98 specified, output is restricted to that user.
  99 .RE
 100 
 101 .SH EXAMPLES
 102 .LP
 103 \fBExample 1 \fRSample Output From the \fBw\fR Command
 104 .sp
 105 .in +2
 106 .nf
 107 example% \fBw\fR
 108 
 109 
 110 10:54am  up 27 day(s), 57 mins,  1 user,  load average: 0.28, 0.26, 0.22
 111 User        tty             login@    idle         JCPU    PCPU     what
 112 ralph    console  7:10am    1       10:05   4:31     w
 113 .fi
 114 .in -2
 115 .sp
 116 
 117 .SH ENVIRONMENT VARIABLES
 118 .sp
 119 .LP
 120 See  \fBenviron\fR(5) for descriptions of the following environment variables
 121 that affect the execution of \fBw\fR: \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and
 122 \fBLC_TIME\fR.
 123 .SH FILES
 124 .sp
 125 .ne 2
 126 .na
 127 \fB\fB/var/adm/utmpx\fR\fR
 128 .ad
 129 .RS 18n
 130 user and accounting information
 131 .RE
 132 
 133 .SH SEE ALSO
 134 .sp
 135 .LP
 136 \fBps\fR(1), \fBwho\fR(1), \fBwhodo\fR(1M), \fButmpx\fR(4),
 137 \fBattributes\fR(5), \fBenviron\fR(5)
 138 .SH NOTES
 139 .sp
 140 .LP
 141 The notion of the "current process" is unclear. The current algorithm is "the
 142 highest numbered process on the terminal that is not ignoring interrupts, or,
 143 if there is none, the highest numbered process on the terminal". This fails,
 144 for example, in critical sections of programs like the shell and editor, or
 145 when faulty programs running in the background fork and fail to ignore
 146 interrupts. In cases where no process can be found, \fBw\fR prints
 147 \fB\(mi\fR\&.
 148 .sp
 149 .LP
 150 The \fBCPU\fR time is only an estimate, in particular, if someone leaves a
 151 background process running after logging out, the person currently on that
 152 terminal is ``charged'' with the time.
 153 .sp
 154 .LP
 155 Background processes are not shown, even though they account for much of the
 156 load on the system.
 157 .sp
 158 .LP
 159 Sometimes processes, typically those in the background, are printed with null
 160 or garbaged arguments. In these cases, the name of the command is printed in
 161 parentheses.
 162 .sp
 163 .LP
 164 \fBw\fR does not know about the conventions for detecting background jobs. It
 165 will sometimes find a background job instead of the right one.