Move everything from /var/adm to /var/log
[unleashed.git] / share / man / man1 / who.1
blobdef786ba34420b461bd997e812cb5d0089f1c271
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Copyright 1989 AT&T
44 .\" Portions Copyright (c) 1992, X/Open Company Limited  All Rights Reserved
45 .\" Copyright (c) 2000, Sun Microsystems, Inc.  All Rights Reserved
46 .\"
47 .TH WHO 1 "Oct 25, 2017"
48 .SH NAME
49 who \- who is on the system
50 .SH SYNOPSIS
51 .LP
52 .nf
53 \fB/usr/bin/who\fR [\fB-abdHlmpqrtTu\fR] [\fIfile\fR]
54 .fi
56 .LP
57 .nf
58 \fB/usr/bin/who\fR \fB-q\fR [\fB-n\fR \fIx\fR] [\fIfile\fR]
59 .fi
61 .LP
62 .nf
63 \fB/usr/bin/who\fR \fB-s\fR [\fB-bdHlmpqrtu\fR] [\fIfile\fR]
64 .fi
66 .LP
67 .nf
68 \fB/usr/bin/who\fR am i
69 .fi
71 .LP
72 .nf
73 \fB/usr/bin/who\fR am I
74 .fi
76 .SH DESCRIPTION
77 .LP
78 The \fBwho\fR utility can list the user's name, terminal line, login time,
79 elapsed time since activity occurred on the line, and the process-ID of the
80 command interpreter (shell) for each current UNIX system user. It examines the
81 \fB/var/log/utmpx\fR file to obtain its information. If \fIfile\fR is given,
82 that file (which must be in \fButmpx\fR(4) format) is examined. Usually,
83 \fIfile\fR will be \fB/var/log/wtmpx\fR, which contains a history of all the
84 logins since the file was last created.
85 .sp
86 .LP
87 The general format for output is:
88 .sp
89 .in +2
90 .nf
91 \fIname\fR [\fIstate\fR] \fIline time\fR [\fIidle\fR] [\fIpid\fR] [\fIcomment\fR] [\fIexit\fR]
92 .fi
93 .in -2
94 .sp
96 .sp
97 .LP
98 where:
99 .sp
100 .ne 2
102 \fB\fIname\fR \fR
104 .RS 12n
105 User's login name
109 .ne 2
111 \fB\fIstate\fR \fR
113 .RS 12n
114 Capability of writing to the terminal
118 .ne 2
120 \fB\fIline\fR \fR
122 .RS 12n
123 Name of the line found in \fB/dev\fR
127 .ne 2
129 \fB\fItime\fR \fR
131 .RS 12n
132 Time since user's login
136 .ne 2
138 \fB\fIidle\fR \fR
140 .RS 12n
141 Time elapsed since the user's last activity
145 .ne 2
147 \fB\fIpid\fR \fR
149 .RS 12n
150 User's process id
154 .ne 2
156 \fB\fIcomment\fR \fR
158 .RS 12n
159 Comment line in \fBinittab\fR(4)
163 .ne 2
165 \fB\fIexit\fR \fR
167 .RS 12n
168 Exit status for dead processes
171 .SH OPTIONS
173 The following options are supported:
175 .ne 2
177 \fB\fB-a\fR \fR
179 .RS 9n
180 Processes \fB/var/log/utmpx\fR or the named \fIfile\fR with \fB-b\fR, \fB-d\fR,
181 \fB-l\fR, \fB-p\fR, \fB-r\fR, \fB-t\fR, \fB-T\fR, and \fB-u\fR options turned
186 .ne 2
188 \fB\fB-b\fR \fR
190 .RS 9n
191 Indicates the time and date of the last reboot.
195 .ne 2
197 \fB\fB-d\fR \fR
199 .RS 9n
200 Displays all processes that have expired and not been respawned by \fBinit\fR.
201 The \fBexit\fR field appears for dead processes and contains the termination
202 and exit values of the dead process. This
203 can be useful in determining why a process terminated.
207 .ne 2
209 \fB\fB-H\fR \fR
211 .RS 9n
212 Outputs column headings above the regular output.
216 .ne 2
218 \fB\fB-l\fR \fR
220 .RS 9n
221 Lists only those lines on which the system is waiting for someone to login. The
222 \fIname\fR field is \fBLOGIN\fR in such cases. Other fields are the same as for
223 user entries except that the \fIstate\fR field does not exist.
227 .ne 2
229 \fB\fB-m\fR \fR
231 .RS 9n
232 Outputs only information about the current terminal.
236 .ne 2
238 \fB\fB-n\fR \fIx\fR \fR
240 .RS 9n
241 Takes a numeric argument, \fIx\fR, which specifies the number of users to
242 display per line. \fIx\fR must be at least \fB1\fR. The \fB-n\fR option can
243 only be used with \fB-q\fR.
247 .ne 2
249 \fB\fB-p\fR \fR
251 .RS 9n
252 Lists any other process that is currently active and has been previously
253 spawned by \fBinit\fR. The \fIname\fR field is the name of the program executed
254 by \fBinit\fR as found in \fB/sbin/inittab\fR. The \fIstate\fR, \fIline\fR, and
255 \fIidle\fR fields have no meaning. The \fIcomment\fR field shows the \fBid\fR
256 field of the line from \fB/sbin/inittab\fR that spawned this process. See
257 \fBinittab\fR(4).
261 .ne 2
263 \fB\fB-q\fR \fR
265 .RS 9n
266 (Quick \fBwho\fR) Displays only the names and the number of users currently
267 logged on. When this option is used, all other options are ignored.
271 .ne 2
273 \fB\fB-r\fR \fR
275 .RS 9n
276 Indicates the current \fIrun-level\fR of the \fBinit\fR process.
280 .ne 2
282 \fB\fB-s\fR \fR
284 .RS 9n
285 (Default) Lists only the \fIname\fR, \fIline\fR, and \fItime\fR fields.
289 .ne 2
291 \fB\fB-T\fR \fR
293 .RS 7n
294 Same as the \fB-s\fR option, except that the \fIstate\fR field is also written.
295 \fIstate\fR is one of the characters listed under the \fB/usr/bin/who\fR
296 version of this option. If the \fB-u\fR option is used with \fB-T\fR, the idle
297 time is added to the end of the previous format.
301 .ne 2
303 \fB\fB-t\fR \fR
305 .RS 7n
306 Indicates the last change to the system clock (using the \fBdate\fR utility) by
307 \fBroot\fR. See \fBsu\fR(8) and \fBdate\fR(1).
311 .ne 2
313 \fB\fB-u\fR \fR
315 .RS 7n
316 Lists only those users who are currently logged in. The \fIname\fR is the
317 user's login name. The \fIline\fR is the name of the line as found in the
318 directory \fB/dev\fR. The \fItime\fR is the time that the user logged in. The
319 \fIidle\fR column contains the number of hours and minutes since activity last
320 occurred on that particular line. A dot (\fB\&.\fR) indicates that the terminal
321 has seen activity in the last minute and is therefore ``current.'' If more than
322 twenty-four hours have elapsed or the line has not been used since boot time,
323 the entry is marked \fBold\fR. This field is useful when trying to determine
324 whether a person is working at the terminal or not. The \fIpid\fR is the
325 process-ID of the user's shell. The \fIcomment\fR is the comment field
326 associated with this line as found in \fB/sbin/inittab\fR (see
327 \fBinittab\fR(4)). This can contain information about where the terminal is
328 located, the telephone number of the dataset, type of terminal if hard-wired,
329 and so forth.
332 .SH OPERANDS
334 The following operands are supported:
336 .ne 2
338 \fB\fBam\fR \fBi\fR \fR
342 \fB\fBam\fR \fBI\fR \fR
344 .RS 9n
345 In the "C" locale, limits the output to describing the invoking user,
346 equivalent to the \fB-m\fR option. The \fBam\fR and \fBi\fR or \fBI\fR must be
347 separate arguments.
351 .ne 2
353 \fB\fIfile\fR \fR
355 .RS 9n
356 Specifies a path name of a file to substitute for the database of logged-on
357 users that \fBwho\fR uses by default.
360 .SH ENVIRONMENT VARIABLES
362 See \fBenviron\fR(5) for descriptions of the following environment variables
363 that affect the execution of \fBwho\fR: \fBLANG\fR, \fBLC_ALL\fR,
364 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, \fBLC_TIME\fR, and \fBNLSPATH\fR.
365 .SH EXIT STATUS
367 The following exit values are returned:
369 .ne 2
371 \fB\fB0\fR \fR
373 .RS 7n
374 Successful completion.
378 .ne 2
380 \fB\fB>0\fR \fR
382 .RS 7n
383 An error occurred.
386 .SH FILES
387 .ne 2
389 \fB\fB/sbin/inittab\fR \fR
391 .RS 19n
392 Script for \fBinit\fR
396 .ne 2
398 \fB\fB/var/log/utmpx\fR \fR
400 .RS 19n
401 Current user and accounting information
405 .ne 2
407 \fB\fB/var/log/wtmpx\fR \fR
409 .RS 19n
410 Historic user and accounting information
413 .SH ATTRIBUTES
415 See \fBattributes\fR(5) for descriptions of the following attributes:
417 box;
418 c | c
419 l | l .
420 ATTRIBUTE TYPE  ATTRIBUTE VALUE
422 Interface Stability     Standard
425 .SH SEE ALSO
427 \fBdate\fR(1), \fBlogin\fR(1), \fBmesg\fR(1), \fBinit\fR(8), \fBsu\fR(8),
428 \fBinittab\fR(4), \fButmpx\fR(4), \fBattributes\fR(5),
429 \fBenviron\fR(5), \fBstandards\fR(5)
430 .SH NOTES
432 \fBSuperuser:\fR After a shutdown to the single-user state, \fBwho\fR returns a
433 prompt. Since \fB/var/log/utmpx\fR is updated at login time and there is no
434 login in single-user state, \fBwho\fR cannot report accurately on this state.
435 The command, \fBwho\fR \fBam i\fR, however, returns the correct information.