Annotation of src/usr.bin/who/who.1, Revision 1.12
1.12 ! aaron 1: .\" $OpenBSD: who.1,v 1.11 2000/03/23 21:39:56 aaron Exp $
1.1 deraadt 2: .\" $NetBSD: who.1,v 1.5 1994/12/07 04:28:47 jtc Exp $
3: .\"
4: .\" Copyright (c) 1986, 1991, 1993
5: .\" The Regents of the University of California. All rights reserved.
6: .\"
7: .\" Redistribution and use in source and binary forms, with or without
8: .\" modification, are permitted provided that the following conditions
9: .\" are met:
10: .\" 1. Redistributions of source code must retain the above copyright
11: .\" notice, this list of conditions and the following disclaimer.
12: .\" 2. Redistributions in binary form must reproduce the above copyright
13: .\" notice, this list of conditions and the following disclaimer in the
14: .\" documentation and/or other materials provided with the distribution.
15: .\" 3. All advertising materials mentioning features or use of this software
16: .\" must display the following acknowledgement:
17: .\" This product includes software developed by the University of
18: .\" California, Berkeley and its contributors.
19: .\" 4. Neither the name of the University nor the names of its contributors
20: .\" may be used to endorse or promote products derived from this software
21: .\" without specific prior written permission.
22: .\"
23: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33: .\" SUCH DAMAGE.
34: .\"
35: .\" @(#)who.1 8.2 (Berkeley) 12/30/93
36: .\"
37: .Dd December 6, 1994
38: .Dt WHO 1
39: .Os
40: .Sh NAME
41: .Nm who
42: .Nd display who is logged in
43: .Sh SYNOPSIS
44: .Nm who
45: .Op Fl mTu
1.7 aaron 46: .Op Ar file
1.1 deraadt 47: .Nm who
48: .Ar am i
49: .Sh DESCRIPTION
1.7 aaron 50: The
51: .Nm
1.1 deraadt 52: utility displays a list of all users currently logged on, showing for
53: each user the login name, tty name, the date and time of login, and
54: hostname if not local.
55: .Pp
1.8 aaron 56: The options are as follows:
1.1 deraadt 57: .Bl -tag -width file
58: .It Fl m
1.10 aaron 59: Only print information about the current terminal.
60: This is the
1.1 deraadt 61: .Tn POSIX
62: way of saying
1.7 aaron 63: .Nm
1.1 deraadt 64: .Ar am i .
1.4 denny 65: .It Fl q
66: (Quick.) List only the names and the number of users currently
1.11 aaron 67: logged on.
68: When this option is used, all other options are ignored.
1.1 deraadt 69: .It Fl T
70: Print a character after the user name indicating the state of the
71: terminal line:
1.7 aaron 72: .Sq +
1.1 deraadt 73: if the terminal is writable;
1.7 aaron 74: .Sq \-
1.1 deraadt 75: if it is not;
76: and
77: .Sq ?
78: if a bad line is encountered.
79: .It Fl u
80: Print the idle time for each user.
1.3 flipk 81: .It Fl H
82: Write column headings above the regular output.
1.1 deraadt 83: .It Ar \&am I
1.7 aaron 84: Returns the invoker's real user name.
1.1 deraadt 85: .It Ar file
86: By default,
1.7 aaron 87: .Nm
1.1 deraadt 88: gathers information from the file
89: .Pa /var/run/utmp .
90: An alternate
91: .Ar file
92: may be specified which is usually
93: .Pa /var/log/wtmp
94: (or
95: .Pa /var/log/wtmp.[0-6]
96: depending on site policy as
97: .Pa wtmp
98: can grow quite large and daily versions may or may not
99: be kept around after compression by
100: .Xr ac 8 ) .
101: The
102: .Pa wtmp
103: file contains a record of every login, logout,
104: crash, shutdown and date change
105: since
106: .Pa wtmp
107: was last truncated or
108: created.
109: .El
110: .Pp
111: If
112: .Pa /var/log/wtmp
113: is being used as the file, the user name may be empty
1.10 aaron 114: or one of the special characters
115: .Ql | ,
116: .Ql } ,
117: and
118: .Ql \&~ .
119: Logouts produce an output line without any user name.
120: For more information on the special characters, see
1.1 deraadt 121: .Xr utmp 5 .
122: .Sh FILES
123: .Bl -tag -width /var/log/wtmp.[0-6] -compact
124: .It Pa /var/run/utmp
125: .It Pa /var/log/wtmp
126: .It Pa /var/log/wtmp.[0-6]
127: .El
128: .Sh SEE ALSO
129: .Xr last 1 ,
130: .Xr mesg 1 ,
131: .Xr users 1 ,
132: .Xr getuid 2 ,
133: .Xr utmp 5
1.9 aaron 134: .Sh STANDARDS
135: The
136: .Nm
137: utility is expected to conform to
138: .St -p1003.2-92 .
1.1 deraadt 139: .Sh HISTORY
140: A
141: .Nm
142: utility appeared in
1.12 ! aaron 143: .At v5 .