1.\" $NetBSD: who.1,v 1.22 2007/01/18 00:15:05 wiz Exp $ 2.\" 3.\" Copyright (c) 1986, 1991, 1993 4.\" The Regents of the University of California. All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. Neither the name of the University nor the names of its contributors 15.\" may be used to endorse or promote products derived from this software 16.\" without specific prior written permission. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" SUCH DAMAGE. 29.\" 30.\" @(#)who.1 8.2 (Berkeley) 12/30/93 31.\" 32.Dd January 17, 2007 33.Dt WHO 1 34.Os 35.Sh NAME 36.Nm who 37.Nd display who is logged in 38.Sh SYNOPSIS 39.Nm 40.Op Fl abdHlmqrstTuv 41.Op Ar file 42.Nm 43.Ar am i 44.Sh DESCRIPTION 45The 46.Nm 47utility displays a list of all users currently logged on, showing for 48each user the login name, tty name, the date and time of login, and 49hostname if not local. 50.Pp 51Available options: 52.Pp 53.Bl -tag -width file 54.It Fl a 55Same as 56.Fl -bdlprTtuv . 57.It Fl b 58Time of last system boot. 59.It Fl d 60Print dead processes. 61.It Fl H 62Write column headings above the regular output. 63.It Fl l 64Print system login processes. 65.It Fl m 66Only print information about the current terminal. 67This is the 68.Tn POSIX 69way of saying 70.Nm 71.Ar am i . 72.It Fl p 73Print active processes spawned by 74.Xr init 8 . 75.It Fl q 76.Dq Quick mode : 77List only the names and the number of users currently logged on. 78When this option is used, all other options are ignored. 79.It Fl r 80Print the current runlevel. 81Supported runlevels are: 82.Bl -tag -width "s (SINGLE_USER)" 83.It Dv d Pq Dv DEATH 84The system has halted. 85.It Dv s Pq Dv SINGLE_USER 86The system is running in single user mode. 87.It Dv r Pq Dv RUNCOM 88The system is executing 89.Pa /etc/rc . 90.It Dv t Pq Dv READ_TTYS 91The system is processing 92.Pa /etc/ttys . 93.It Dv m Pq Dv MULTI_USER 94The system is running in multi-user mode. 95.It Dv T Pq Dv CLEAN_TTYS 96The system is in the process of stopping processes 97associated with terminal devices. 98.It Dv c Pq Dv CATATONIA 99The system is in the process of shutting down and will 100not create new processes. 101.El 102.It Fl s 103List only the name, line and time fields. 104This is the default. 105.It Fl T 106Print a character after the user name indicating the state of the 107terminal line: 108.Sq + 109if the terminal is writable; 110.Sq - 111if it is not; 112and 113.Sq \&? 114if a bad line is encountered. 115.It Fl t 116Print last system clock change. 117.It Fl u 118Print the idle time for each user, and the associated process ID. 119.It Fl v 120When printing of more information is requested with 121.Fl u , 122this switch can be used to also printed 123process termination signals, 124process exit status, 125session id for windowing 126and the type of the entry, see documentation of ut_type in 127.Xr getutxent 3 . 128.It Ar \&am I 129Returns the invoker's real user name. 130.It Ar file 131By default, 132.Nm 133gathers information from the file 134.Pa /var/run/utmpx . 135An alternative 136.Ar file 137may be specified which is usually 138.Pa /var/log/wtmpx 139(or 140.Pa /var/log/wtmp , 141or 142.Pa /var/log/wtmpx.[0-6] 143or 144.Pa /var/log/wtmp.[0-6] 145depending on site policy as 146.Pa wtmpx 147can grow quite large and daily versions may or may not 148be kept around after compression by 149.Xr ac 8 ) . 150The 151.Pa wtmpx 152and 153.Pa wtmp 154file contains a record of every login, logout, 155crash, shutdown and date change 156since 157.Pa wtmpx 158and 159.Pa wtmp 160were last truncated or 161created. 162.El 163.Pp 164If 165.Pa /var/log/wtmpx 166or 167.Pa /var/log/wtmp 168are being used as the file, the user name may be empty 169or one of the special characters '|', '}' and '~'. 170Logouts produce an output line without any user name. 171For more information on the 172special characters, see 173.Xr utmp 5 . 174.Sh FILES 175.Bl -tag -width /var/log/wtmp.[0-6] -compact 176.It Pa /var/run/utmp 177.It Pa /var/run/utmpx 178.It Pa /var/log/wtmp 179.It Pa /var/log/wtmp.[0-6] 180.It Pa /var/log/wtmpx 181.It Pa /var/log/wtmpx.[0-6] 182.El 183.Sh SEE ALSO 184.Xr last 1 , 185.Xr mesg 1 , 186.Xr users 1 , 187.Xr getuid 2 , 188.Xr utmp 5 , 189.Xr utmpx 5 190.Sh STANDARDS 191The 192.Nm 193utility is expected to conform to 194.St -p1003.2-92 . 195.Sh HISTORY 196A 197.Nm 198utility appeared in 199.At v6 . 200