who.1 (2010 09)

w
who(1) who(1)
NAME
who - who is on the system
SYNOPSIS
who [-muTlHqpdbrtasARW
][file ]
who am i
who am I
DESCRIPTION
The who command can list the user’s name, terminal line, login time, elapsed time since input activity
occurred on the line, the user’s host name, and the process-ID of the command interpreter (shell) for each
current system user. It examines the utmps
database to obtain the information. If file is given, that file
is examined, file should be a
utmp like file.
The
who command with the am i
or am I option identifies the invoking user.
Except for the default
-s option, the general format for output entries is:
name [ state ] line time activity 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
-m Output only information about the current terminal. This option is equivalent to
the am i and am I options described above.
-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. The time field indicates
when the user logged in.
activity is the number of hours and minutes since input activity last occurred on
that particular line. A dot (
. ) indicates that the terminal has seen activity in the
last minute and is therefore ‘‘current’’. If more than twenty-four hours have elapsed
or the line has not been used since boot time, the entry is marked old. This field is
useful when trying to determine whether a person is working at the terminal or not.
The pid is the process-ID of the user’s login process. The comment is the comment
field associated with this line as found in
/etc/inittab (see inittab (4)). This
can contain information about where the terminal is located, the telephone number
of the dataset, type of terminal if hard-wired, etc. If no such information is found,
then who prints, as the comment, the user’s host name as it was stored in the
utmps database or named file. Note that the user’s host name is printed instead of
comments from the /etc/inittab file if the -u option is used in conjunction with
the -R option.
-T Same as the -u option, except that the state of the terminal line is printed. state
describes whether someone else can write to that terminal. A + appears if the ter-
minal 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.
(UNIX Standard only, see standards (5).) Only the following fields are displayed:
name state line time
-l Lists only those lines on which the system is waiting for someone to login. The
name field is LOGIN in such cases. Other fields are the same as for user entries
except that the state field does not exist.
-H Prints column headings above the regular output.
-q A quick who, displaying only the names and the number of users currently logged
in. When this option is used, all other options are ignored.
-p Lists any other process which is currently active and has been previously spawned
by init . The name field is the name of the program executed by init as found in
/etc/inittab. The state , line , and activity fields have no meaning. The com-
ment field shows the id field of the line from /etc/inittab that spawned this
process. See inittab (4).
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (4 pages)