WHO(1) BSD WHO(1)
NAME
who - who is on the system
SYNOPSIS
who [ -w ] [ -a | -d | -f nodefile | -n arg] [ who-file ]
who [ am i ]
DESCRIPTION
who, without any options or arguments, lists the log-in name, terminal
name, and log-in time for each user currently logged in.
Without an argument, who examines the /etc/utmp file to obtain its
information. If you specify a file, that file is used instead of
/etc/utmp. Typically the specified file is /usr/adm/wtmp, which contains
a record of all the logins since it was created. Then who lists logins,
logouts, and crashes since the creation of the wtmp file. Each login is
listed with username, terminal name (with /dev/ suppressed), and date and
time. When an argument is given, logouts produce a similar line without
a username. Reboots produce a line with x in place of the device name,
and a fossil time indicative of when the system went down.
who am i (or who with two arguments) tells who you are logged in as.
Domain/OS BSD OPTIONS
-w Produces wide output. Normally, lines are printed with the
name and node fields 20 characters wide. The -w option prints
the maximum name and node field widths.
-a Processes /etc/utmp or the named file for all nodes in the
ring.
-d Displays information about all nodes booted off the current
boot volume. This can be useful for listing users who should
be notified of an impending system shutdown.
-f nodefile
Specifies nodes for which /etc/utmp will be 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.
-n arg1[,arg2...]
Specifies nodes for which /etc/utmp will be processed. The 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 should be in
quotes.
You can use only one of -a, -d, -f, or -n.
WARNINGS
/etc/utmp can be an unreliable source of login information. /etc/utmp is
written by the most recently executed /bin/login, which is not
necessarily the same as the current login. whoami does not read
/etc/utmp, and is a more accurate method for getting the current user id.
FILES
/etc/utmp
SEE ALSO
last(1), whoami(1), getuid(2), getpwent(3), utmp(5)