xref: /openbsd/usr.bin/who/who.1 (revision 07ea8d15)
1.\"	$OpenBSD: who.1,v 1.2 1996/06/26 05:43:00 deraadt Exp $
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
46.Op Ar file
47.Nm who
48.Ar am i
49.Sh DESCRIPTION
50The
51.Nm who
52utility displays a list of all users currently logged on, showing for
53each user the login name, tty name, the date and time of login, and
54hostname if not local.
55.Pp
56Available options:
57.Pp
58.Bl -tag -width file
59.It Fl m
60Only print information about the current terminal.  This is the
61.Tn POSIX
62way of saying
63.Nm who
64.Ar am i .
65.It Fl T
66Print a character after the user name indicating the state of the
67terminal line:
68.Sq +
69if the terminal is writable;
70.Sq -
71if it is not;
72and
73.Sq ?
74if a bad line is encountered.
75.It Fl u
76Print the idle time for each user.
77.It Ar \&am I
78Returns the invoker's real user name.
79.It Ar file
80By default,
81.Nm who
82gathers information from the file
83.Pa /var/run/utmp .
84An alternate
85.Ar file
86may be specified which is usually
87.Pa /var/log/wtmp
88(or
89.Pa /var/log/wtmp.[0-6]
90depending on site policy as
91.Pa wtmp
92can grow quite large and daily versions may or may not
93be kept around after compression by
94.Xr ac 8 ) .
95The
96.Pa wtmp
97file contains a record of every login, logout,
98crash, shutdown and date change
99since
100.Pa wtmp
101was last truncated or
102created.
103.El
104.Pp
105If
106.Pa /var/log/wtmp
107is being used as the file, the user name may be empty
108or one of the special characters '|', '}' and '~'.  Logouts produce
109an output line without any user name.  For more information on the
110special characters, see
111.Xr utmp 5 .
112.Sh FILES
113.Bl -tag -width /var/log/wtmp.[0-6] -compact
114.It Pa /var/run/utmp
115.It Pa /var/log/wtmp
116.It Pa /var/log/wtmp.[0-6]
117.El
118.Sh SEE ALSO
119.Xr last 1 ,
120.Xr mesg 1 ,
121.Xr users 1 ,
122.Xr getuid 2 ,
123.Xr utmp 5
124.Sh HISTORY
125A
126.Nm
127utility appeared in
128.At v6 .
129.Sh STANDARDS
130The
131.Nm
132utility is expected to conform to
133.St -p1003.2-92 .
134