who(1)
_________________________________________________________________
who Command
who is on the system
_________________________________________________________________
SYNTAX
who [-uATHlpdbrtasqh] [ file ]
who am i
who am I
DESCRIPTION
Who can list the user's name, terminal line, login time, elapsed
time since activity occurred on the line, and the process ID of
the shell for each current system user. It examines the
/etc/utmp file to get this information, or it examines file if it
is given. Usually, file will be /etc/wtmp, which contains a
history of all the logins since the file was last created.
Who with the am i or am I option identifies the invoking user.
Except for the default -s option, the general format for output
from this command is:
name [state] line time activity pid [comment] [exit]
[hostname]
With options, who can list logins, logoffs, reboots, and changes
to the system clock, as well as other processes spawned by the
init process. These options are:
-u Lists only those users currently logged in. The name is
the user's login name. The line is the name of the line as
found in the directory /dev.
The time is the time that the user logged in. The activity
is the number of hours and minutes since 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 shell.
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)
who(1)
The comment is the comment field associated with this line
as found in /etc/inittab (see inittab(4)). This can
contain information such as where the terminal is located,
the telephone number of the dataset, and the type of
terminal if it is hard-wired.
-A Print entries made by the acct(1M) subsystem.
-T Same as the -u option, 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.
-l Lists only those lines on which the system is waiting for
someone to login. The name field in this case is LOGIN.
Other fields are the same as for user entries, except that
the state field does not exist.
-p Lists any other active process that was also 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 comment field shows
the id field of the line from /etc/inittab that spawned
this process. See inittab(4).
-d Displays all processes that have expired and not been
respawned by init. The exit field appears for a dead
process and contains its termination and exit values, as
returned by wait(2). This can be useful in determining why
a process terminated.
-b Indicates the time and date of the last reboot.
-r Indicates the current run-level of the init process.
-t Indicates the last change to the system clock (via the
date(1) command) by root. See su(1).
-a Processes /etc/utmp or the named file with all options
turned on.
-s The default--lists only the name, line, and time fields.
-H Prints column headings above the regular output.
-q This is a quick who, displaying only the names and the
number of users currently logged on. When this option is
used, all other options except n are ignored.
DG/UX 4.00 Page 2
Licensed material--property of copyright holder(s)
who(1)
-n # This option should be used with -q. It lets you specify
the number of users you want to be displayed per line.
-h This option prints host names for remote users
_________________________________________________________________
EXAMPLES
$ who am i
user1 tty21 Nov 19 09:54
The above example displays the user who invoked the who command.
$ who -u
sys_mgr tty01 Nov 19 09:00 1:53 690
donnelly tty02 Nov 19 08:56 0:20 144
crumley tty20 Nov 19 09:32 . 151
user1 tty21 Nov 19 09:54 . 974
user2 tty12 Nov 19 13:19 0:06 1728
The above example shows all users logged onto the system, which
terminal they have logged onto, the date and time, the amount of
time since last activity ("." indicates less than one minute),
and the user's PID.
$ who -b
. system boot Nov 18 21:34
The above example shows the date and time that the system was
last booted.
_________________________________________________________________
FILES
/etc/utmp
/etc/wtmp
/etc/inittab
SEE ALSO
date(1), login(1), mesg(1), su(1).
wait(2), inittab(4), utmp(4) in the Programmer's Reference for
the DG/UX System
DG/UX 4.00 Page 3
Licensed material--property of copyright holder(s)
who(1)
init(1m) in the System Manager's Reference for the DG/UX System
DG/UX 4.00 Page 4
Licensed material--property of copyright holder(s)