WHO(1) SysV WHO(1)
NAME
who - who is on the system
SYNOPSIS
who [ -bdHqstTu ] [ file ]
who [ -bdHqstTu ] [ -a | -d | -n arg ]
who am i
who am I
DESCRIPTION
who lists the name, terminal line, login time, elapsed time since
activity occurred on the line, and the process-ID for each current UNIX
system user. It examines the /etc/utmp file at login time to obtain its
information. If file is given, that file (which must be in utmp(4)
format) is examined. file is usually /etc/wtmp, which contains a history
of all the logins since the file was last created.
who with either the am i or am I option identifies the invoking user.
The general format for output is:
name [state] line time [idle] [pid] [comment] [exit]
With options, who can list logins, logoffs, reboots, and changes to the
system clock, as well as other processes spawned by the init process.
OPTIONS
-a Processes /etc/utmp or the named file for all nodes in the
ring.
-b Indicates the time and date of the last reboot.
-d Display all nodes which have been booted diskless from the node
specified. The default is the node from which the command is
executed.
-fnodefile
Specifies nodes for which /etc/utmp are processed. nodefile
should contain lines in the form: //nodename or [net.]nodeid,
one per line. A pound sign (#) in the first column causes that
line to be treated as a comment.
-H Prints column headings above the regular output.
-narg1 [ ,arg2 ]
Specificies nodes for which /etc/utmp are processed. arg lists
the nodes to be processed, and should be in the form:
//nodename or [net.]nodeid. If more than one node is specified
they should be either separated by commas or separated by
whitespace and the entire argument in quotes.
-q Displays only the names and the number of users currently
logged on. When this option is used, all other options are
ignored.
-s Lists only the name, line, and time fields. This is the
default option.
-t Indicates the last change to the system clock (via date(1)) by
root. See su(1).
-T The same as -s except that the state of the terminal line is
printed. The state describes whether someone else can write to
that terminal. A + appears if the terminal is writable by
anyone; a - appears if it is not. root can write to all lines
having a + or a - in the state field. If a bad line is
encountered, a ? is printed.
-u Lists only those users who are currently logged in. name is
the user's login name. line is the name of the line as found
in the directory /dev. time is the time that the user logged
in.
NOTES
All options produce name, line, and time information except -q; only -T
produces state information.
After a shutdown to the single-user state, who returns a prompt; the
reason is that since /etc/utmp is updated at login time and there is no
login in single-user state, who cannot report accurately on this state.
who am i, however, returns the correct information.
FILES
/etc/utmp
/etc/wtmp
SEE ALSO
date(1), login(1), mesg(1), su(1M).
init(1M) in the Managing SysV System Software.
wait(2) in the SysV Programmer's Reference.