6001 strcat(9f) needs a manpage
[unleashed.git] / usr / src / man / man1 / who.1
blob3e2c121ee75669528f922ed91f46a0a9de432cd0
1 '\" te
2 .\" Copyright 1989 AT&T
3 .\" Copyright (c) 2000, Sun Microsystems, Inc.  All Rights Reserved
4 .\" Portions Copyright (c) 1992, X/Open Company Limited  All Rights Reserved
5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
6 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
8 .\"  This notice shall appear on any product containing this material.
9 .\" 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.
10 .\" 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.
11 .\" 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]
12 .TH WHO 1 "Nov 3, 2000"
13 .SH NAME
14 who \- who is on the system
15 .SH SYNOPSIS
16 .LP
17 .nf
18 \fB/usr/bin/who\fR [\fB-abdHlmpqrstTu\fR] [\fIfile\fR]
19 .fi
21 .LP
22 .nf
23 \fB/usr/bin/who\fR \fB-q\fR [\fB-n\fR \fIx\fR] [\fIfile\fR]
24 .fi
26 .LP
27 .nf
28 \fB/usr/bin/who\fR am i
29 .fi
31 .LP
32 .nf
33 \fB/usr/bin/who\fR am I
34 .fi
36 .LP
37 .nf
38 \fB/usr/xpg4/bin/who\fR [\fB-abdHlmpqrtTu\fR] [\fIfile\fR]
39 .fi
41 .LP
42 .nf
43 \fB/usr/xpg4/bin/who\fR \fB-q\fR [\fB-n\fR \fIx\fR] [\fIfile\fR]
44 .fi
46 .LP
47 .nf
48 \fB/usr/xpg4/bin/who\fR \fB-s\fR [\fB-bdHlmpqrtu\fR] [\fIfile\fR]
49 .fi
51 .LP
52 .nf
53 \fB/usr/xpg4/bin/who\fR am i
54 .fi
56 .LP
57 .nf
58 \fB/usr/xpg4/bin/who\fR am I
59 .fi
61 .SH DESCRIPTION
62 .sp
63 .LP
64 The \fBwho\fR utility can list the user's name, terminal line, login time,
65 elapsed time since activity occurred on the line, and the process-ID of the
66 command interpreter (shell) for each current UNIX system user. It examines the
67 \fB/var/adm/utmpx\fR file to obtain its information. If \fIfile\fR is given,
68 that file (which must be in \fButmpx\fR(4) format) is examined. Usually,
69 \fIfile\fR will be \fB/var/adm/wtmpx\fR, which contains a history of all the
70 logins since the file was last created.
71 .sp
72 .LP
73 The general format for output is:
74 .sp
75 .in +2
76 .nf
77 \fIname\fR [\fIstate\fR] \fIline time\fR [\fIidle\fR] [\fIpid\fR] [\fIcomment\fR] [\fIexit\fR]
78 .fi
79 .in -2
80 .sp
82 .sp
83 .LP
84 where:
85 .sp
86 .ne 2
87 .na
88 \fB\fIname\fR \fR
89 .ad
90 .RS 12n
91 User's login name
92 .RE
94 .sp
95 .ne 2
96 .na
97 \fB\fIstate\fR \fR
98 .ad
99 .RS 12n
100 Capability of writing to the terminal
104 .ne 2
106 \fB\fIline\fR \fR
108 .RS 12n
109 Name of the line found in \fB/dev\fR
113 .ne 2
115 \fB\fItime\fR \fR
117 .RS 12n
118 Time since user's login
122 .ne 2
124 \fB\fIidle\fR \fR
126 .RS 12n
127 Time elapsed since the user's last activity
131 .ne 2
133 \fB\fIpid\fR \fR
135 .RS 12n
136 User's process id
140 .ne 2
142 \fB\fIcomment\fR \fR
144 .RS 12n
145 Comment line in \fBinittab\fR(4)
149 .ne 2
151 \fB\fIexit\fR \fR
153 .RS 12n
154 Exit status for dead processes
157 .SH OPTIONS
160 The following options are supported:
162 .ne 2
164 \fB\fB-a\fR \fR
166 .RS 9n
167 Processes \fB/var/adm/utmpx\fR or the named \fIfile\fR with \fB-b\fR, \fB-d\fR,
168 \fB-l\fR, \fB-p\fR, \fB-r\fR, \fB-t\fR, \fB-T\fR, and \fB-u\fR options turned
173 .ne 2
175 \fB\fB-b\fR \fR
177 .RS 9n
178 Indicates the time and date of the last reboot.
182 .ne 2
184 \fB\fB-d\fR \fR
186 .RS 9n
187 Displays all processes that have expired and not been respawned by \fBinit\fR.
188 The \fBexit\fR field appears for dead processes and contains the termination
189 and exit values (as returned by \fBwait\fR(3UCB)), of the dead process. This
190 can be useful in determining why a process terminated.
194 .ne 2
196 \fB\fB-H\fR \fR
198 .RS 9n
199 Outputs column headings above the regular output.
203 .ne 2
205 \fB\fB-l\fR \fR
207 .RS 9n
208 Lists only those lines on which the system is waiting for someone to login. The
209 \fIname\fR field is \fBLOGIN\fR in such cases. Other fields are the same as for
210 user entries except that the \fIstate\fR field does not exist.
214 .ne 2
216 \fB\fB-m\fR \fR
218 .RS 9n
219 Outputs only information about the current terminal.
223 .ne 2
225 \fB\fB-n\fR \fIx\fR \fR
227 .RS 9n
228 Takes a numeric argument, \fIx\fR, which specifies the number of users to
229 display per line. \fIx\fR must be at least \fB1\fR. The \fB-n\fR option can
230 only be used with \fB-q\fR.
234 .ne 2
236 \fB\fB-p\fR \fR
238 .RS 9n
239 Lists any other process that is currently active and has been previously
240 spawned by \fBinit\fR. The \fIname\fR field is the name of the program executed
241 by \fBinit\fR as found in \fB/sbin/inittab\fR. The \fIstate\fR, \fIline\fR, and
242 \fIidle\fR fields have no meaning. The \fIcomment\fR field shows the \fBid\fR
243 field of the line from \fB/sbin/inittab\fR that spawned this process. See
244 \fBinittab\fR(4).
248 .ne 2
250 \fB\fB-q\fR \fR
252 .RS 9n
253 (Quick \fBwho\fR) Displays only the names and the number of users currently
254 logged on. When this option is used, all other options are ignored.
258 .ne 2
260 \fB\fB-r\fR \fR
262 .RS 9n
263 Indicates the current \fIrun-level\fR of the \fBinit\fR process.
267 .ne 2
269 \fB\fB-s\fR \fR
271 .RS 9n
272 (Default) Lists only the \fIname\fR, \fIline\fR, and \fItime\fR fields.
275 .SS "/usr/bin/who"
277 .ne 2
279 \fB\fB-T\fR \fR
281 .RS 7n
282 Same as the \fB-s\fR option, except that the \fIstate\fR \fIidle\fR, \fIpid\fR,
283 and \fIcomment\fR, fields are also written. \fIstate\fR is one of the following
284 characters:
286 .ne 2
288 \fB\fB+\fR \fR
290 .RS 9n
291 The terminal allows write access to other users.
295 .ne 2
297 \fB\fB\(mi\fR \fR
299 .RS 9n
300 The terminal denies write access to other users.
304 .ne 2
306 \fB\fB?\fR \fR
308 .RS 9n
309 The terminal write-access state cannot be determined.
314 .SS "/usr/xpg4/bin/who"
316 .ne 2
318 \fB\fB-T\fR \fR
320 .RS 7n
321 Same as the \fB-s\fR option, except that the \fIstate\fR field is also written.
322 \fIstate\fR is one of the characters listed under the \fB/usr/bin/who\fR
323 version of this option. If the \fB-u\fR option is used with \fB-T\fR, the idle
324 time is added to the end of the previous format.
328 .ne 2
330 \fB\fB-t\fR \fR
332 .RS 7n
333 Indicates the last change to the system clock (using the \fBdate\fR utility) by
334 \fBroot\fR. See \fBsu\fR(1M) and \fBdate\fR(1).
338 .ne 2
340 \fB\fB-u\fR \fR
342 .RS 7n
343 Lists only those users who are currently logged in. The \fIname\fR is the
344 user's login name. The \fIline\fR is the name of the line as found in the
345 directory \fB/dev\fR. The \fItime\fR is the time that the user logged in. The
346 \fIidle\fR column contains the number of hours and minutes since activity last
347 occurred on that particular line. A dot (\fB\&.\fR) indicates that the terminal
348 has seen activity in the last minute and is therefore ``current.'' If more than
349 twenty-four hours have elapsed or the line has not been used since boot time,
350 the entry is marked \fBold\fR. This field is useful when trying to determine
351 whether a person is working at the terminal or not. The \fIpid\fR is the
352 process-ID of the user's shell. The \fIcomment\fR is the comment field
353 associated with this line as found in \fB/sbin/inittab\fR (see
354 \fBinittab\fR(4)). This can contain information about where the terminal is
355 located, the telephone number of the dataset, type of terminal if hard-wired,
356 and so forth.
359 .SH OPERANDS
362 The following operands are supported:
364 .ne 2
366 \fB\fBam\fR \fBi\fR \fR
370 \fB\fBam\fR \fBI\fR \fR
372 .RS 9n
373 In the "C" locale, limits the output to describing the invoking user,
374 equivalent to the \fB-m\fR option. The \fBam\fR and \fBi\fR or \fBI\fR must be
375 separate arguments.
379 .ne 2
381 \fB\fIfile\fR \fR
383 .RS 9n
384 Specifies a path name of a file to substitute for the database of logged-on
385 users that \fBwho\fR uses by default.
388 .SH ENVIRONMENT VARIABLES
391 See \fBenviron\fR(5) for descriptions of the following environment variables
392 that affect the execution of \fBwho\fR: \fBLANG\fR, \fBLC_ALL\fR,
393 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, \fBLC_TIME\fR, and \fBNLSPATH\fR.
394 .SH EXIT STATUS
397 The following exit values are returned:
399 .ne 2
401 \fB\fB0\fR \fR
403 .RS 7n
404 Successful completion.
408 .ne 2
410 \fB\fB>0\fR \fR
412 .RS 7n
413 An error occurred.
416 .SH FILES
418 .ne 2
420 \fB\fB/sbin/inittab\fR \fR
422 .RS 19n
423 Script for \fBinit\fR
427 .ne 2
429 \fB\fB/var/adm/utmpx\fR \fR
431 .RS 19n
432 Current user and accounting information
436 .ne 2
438 \fB\fB/var/adm/wtmpx\fR \fR
440 .RS 19n
441 Historic user and accounting information
444 .SH ATTRIBUTES
447 See \fBattributes\fR(5) for descriptions of the following attributes:
448 .SS "/usr/xpg4/bin/who"
453 box;
454 c | c
455 l | l .
456 ATTRIBUTE TYPE  ATTRIBUTE VALUE
458 Interface Stability     Standard
461 .SH SEE ALSO
464 \fBdate\fR(1), \fBlogin\fR(1), \fBmesg\fR(1), \fBinit\fR(1M), \fBsu\fR(1M),
465 \fBwait\fR(3UCB), \fBinittab\fR(4), \fButmpx\fR(4), \fBattributes\fR(5),
466 \fBenviron\fR(5), \fBstandards\fR(5)
467 .SH NOTES
470 \fBSuperuser:\fR After a shutdown to the single-user state, \fBwho\fR returns a
471 prompt. Since \fB/var/adm/utmpx\fR is updated at login time and there is no
472 login in single-user state, \fBwho\fR cannot report accurately on this state.
473 The command, \fBwho\fR \fBam i\fR, however, returns the correct information.