WHO(1,C) AIX Commands Reference WHO(1,C)
-------------------------------------------------------------------------------
who
PURPOSE
Identifies the users currently logged in.
SYNTAX
+----- -s ------+ +- /etc/utmp -+
who ---| +--- -a ----+ |---| |---|
+-| +-------+ |-+ +--- file ----+
+-| -b -s |-+
^| -d -t ||
|| -l -T ||
|| -p -u ||
|| -r -L ||
|| -A -H ||
|| -q ||
|+-------+|
+---------+
who am i ---|
DESCRIPTION
The who command with no flags writes to standard output the login name, work
station name, and date and time of login for all users currently on the system.
who am i gives this information only for you.
With flags, who can also display the elapsed time since line activity occurred,
the process-ID of the command interpreter (shell), logins, logouts, restarts,
and changes to the system clock, as well as other processes generated by the
init process.
The general format of the output of who is as follows:
name [state] line time activity pid[location] [exit][sitename]
where:
o name is the user's login name.
o state indicates whether the line is readable by everyone (see the -T flag
on 3).
o line is the name of the line as found in the directory /dev.
o time is the time that user logged in.
o activity is the hours and minutes since activity last occurred on that
user's line. A dot (.) here indicates line activity within the last
Processed November 8, 1990 WHO(1,C) 1
WHO(1,C) AIX Commands Reference WHO(1,C)
minute. If the line has been quiet more than 24 hours or has not been used
since the last system startup, the entry is marked old.
o pid is the process-ID of the user's shell.
o location is the location associated with this line as found in file
/etc/ports.
This file can contain information about where the work station or terminal
is located, the telephone number of the dataset, the type of work station
if direct-connected, and other related information. For users logged in
using rlogin or telnet (see the TCP/IP Users' Guide) the location field
also shows the name of the remote host.
o exit is the exit status of ended processes (see the -d flag on the
following page).
o sitename is the name of the site to which the user is logged on.
To obtain its information, who normally examines /etc/utmp. If you specify
another file, who examines the named file instead. This file is usually
/usr/adm/wtmp, which contains the history of all logins since the file was last
created or /etc/.ilog, which contains the history of invalid logins. Only
someone operating with superuser authority or a member of the system group can
examine /etc/.ilog.
FLAGS
-A Display user's login name.
-a Prints information from /etc/utmp or the named file in a
verbose form.
-b Indicates the time and date of the most recent system
startup. The LANG and LC_TIME environment variables
control the format of the login time and date.
-d Displays all processes that have expired without being
regenerated by init. The exit field appears for dead
processes and contains the termination and exit values
(as returned by wait) of the dead process. (This flag is
useful for determining why a process ended.)
-H Displays a header above each column.
-l Lists only work stations or terminals not in use. The
name field is LOGIN in such cases. Other fields are the
same as for the -u option.
-L Prints information about the local site only. This
option also suppresses the display of the site name for
each user.
-p Lists any active process that is currently active and has
been previously generated by init.
Processed November 8, 1990 WHO(1,C) 2
WHO(1,C) AIX Commands Reference WHO(1,C)
-q Displays a compact list of logged on users similar to the
users command.
-r Indicates the current run-level of the init process.
Following the run level and date information are three
fields that indicate the current state, the number of
times that state was previously entered, and the previous
state.
-s Lists only the name, line, time and host computer fields.
(This is the default; thus, who and who -s are
equivalent.) The LANG and LC_TIME environment variables
control the format of the time.
-t Indicates the last change to the system clock by the
superuser using the date command. The LANG and LC_TIME
environment variables control the format of the time.
-T Displays the state of the work station line and indicates
who can write to that work station as follows:
+ writable by anyone
- writable only by the superuser or its owner
? bad line encountered.
-u Displays the user name, work station name, login time,
line activity, process-ID of each current user, and
either the comment from /etc/inittab, or the originating
host's name, if the user used either telnet or rlogin to
log on to the local host. The LANG and LC_TIME
environment variables control the format of the login
time.
EXAMPLES
1. To display information about who is using the system:
who
This lists the user name, work station name, and login time of all users
currently using the system.
2. To display your user name:
who am i
This displays the user name you typed when you logged in, the name of the
work station you are using, and the time you logged in. Your login user
name may be different from your current user name if you have used the su
command.
Processed November 8, 1990 WHO(1,C) 3
WHO(1,C) AIX Commands Reference WHO(1,C)
3. To display a history of logins, logouts, system startups, and system
shutdowns:
who-as /usr/adm/wtmp
FILES
/etc/utmp Contains user and accounting information for system users.
/usr/adm/wtmp History of all logins on system.
/etc/ports System terminal port definitions.
/etc/.ilog History of invalid login attempts.
RELATED INFORMATION
See the following commands: "date," "init, telinit," "login," "mesg," and
"su."
See the wait system call and the ports and utmp files in AIX Operating System
Technical Reference.
See "Introduction to International Character Support" in Managing the AIX
Operating System.
Processed November 8, 1990 WHO(1,C) 4