'\"macro stdmacro
.if n .pH g1.who @(#)who	41.1 of 12/29/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} who 1 "Essential Utilities" "\&"
.if \nX=1 .ds x} who 1 "Essential Utilities"
.if \nX=2 .ds x} who 1 "" "\&"
.if \nX=3 .ds x} who "" "" "\&"
.TH \*(x}
.SH NAME
\f4who\f1 \- who is on the system
.SH SYNOPSIS
\f4who\f1
\f1[\|\f4\-uTlHqpdbrtas\f1\|]
[ \f2file\f1 ]
.PP
\f4who\^\f1
\|\f4\-qn \f2x\f1 [ \f2file\f1 ]
.PP
\f4who am i\f1
.PP
\f4who am I\f1
.SH DESCRIPTION
\f4who\fP
can list the user's name, terminal line, login time,
elapsed time since activity occurred on the line,
and the process-\s-1ID\s+1 of the command interpreter (shell)
for each current \s-1UNIX\s+1 system user.
It
examines the
\f4/var/adm/utmp\f1
file to obtain its information.
If \f2file\fP is given, that file (which
must be in \f4utmp\fP[4] format) is examined.
Usually, \f2file\fP will be
\f4/var/adm/wtmp\f1,
which contains a history of all the logins since the file
was last created.
.PP
\f4who\f1
with the
\f4am i\f1
or
\f4am I\f1
option identifies the invoking user.
.PP
The general format for output is:
.PP
.RS
name \|[\^state\^] \|line \|time \|[idle] \|[pid] \|[\^comment\^] \|[\^exit\^]
.RE
.PP
The
.IR name ,
.IR line ,
and
.I time
information is produced by all options except
\f4\-q\f1;
the
.I state
information is produced only by
\f4\-T\f1;
the
.I idle
and
.I pid
information is produced only by
\f4\-u\f1
and
\f4\-l\f1;
and
the
.I comment
and
\f4exit\fP
information is produced only by
\f4\-a\f1.
The information produced for
\f4\-p\f1,
\f4\-d\f1,
and
\f4\-r\f1
is explained during the discussion of each option, below.
.PP
With options,
\f4who\fP
can list
logins, logoffs, reboots, and changes to the system clock, as well 
as other
processes spawned by the \f4init\fP process.
These options are:
.TP 6
\f4\-u\f1
This option lists only those users who are currently
logged in.
The
.I name
is the user's login name.
The
\f2line\fP
is the name of the line as found in the directory
\f4/dev\f1.
The
.I time
is the time that the user logged in.
The
.I idle
column contains the number of hours and minutes since activity last occurred on
that particular line.
A
dot
\f1(\f4\^.\^\f1)
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
\f4old\f1.
This field is useful when trying to determine
whether a person is working at the terminal or not.
The
.I pid
is the process-\s-1ID\s+1 of the user's shell.
The
.I comment
is the comment field associated with this line as found in
\f4/sbin/inittab\f1
[see
\f4inittab\fP(4)].
This can contain information about where the terminal is located,
the telephone number of the dataset, type of terminal if hard-wired, etc.
.TP 6
\f4\-T\f1
This option is the same as the
\f4\-s\f1
option, except that the
.I state
of the terminal line is printed.
The
.I state
describes whether someone else can write to that terminal.
A
\f4+\f1
appears if the terminal
is writable by anyone;
a
\f4\-\f1
appears
if it is not.
\f4root\f1
can write to all lines having a
\f4+\f1
or a
\f4\-\f1
in the
.I state
field.
If a bad line is encountered, a
\f4?\f1
is printed.
.TP 6
\f4\-l\f1
This option lists only those lines on which the system is waiting
for someone to login.
The
.I name
field is
\f4\s-1LOGIN\s+1\f1
in such cases.
Other fields are the same as for user entries except that the
.I state
field does not exist.
.TP 6
\f4\-H\f1
This option will print column headings above the regular output.
.TP 6
\f4\-q\f1
This is a quick
\f4who\fP,
displaying only the names and the number of users currently logged on.
When this option is used, all other options are ignored.
.TP 6
\f4\-p\f1
This option lists any other process which is currently active and has
been previously spawned by
\f4init\fP.
The
.I name
field is
the name of the program executed by
\f4init\fP
as found in
\f4/sbin/inittab\f1.
The
.IR state ,
\f4line\fP,
and
.I idle
fields have no meaning.
The
.I comment
field shows
the
\f4id\fP
field of the line from
\f4/sbin/inittab\f1
that spawned this process.
See
\f4inittab\fP(4).
.TP 6
\f4\-d\f1
This option displays all processes
that have expired and not been respawned by 
\f4init\fP.
The
\f4exit\fP
field appears for dead processes and contains the termination and exit
values [as returned by
\f4wait\fP(2)],
of the dead process.
This can be useful in determining why a process
terminated.
.TP 6
\f4\-b\f1
This option indicates the time and date of the last reboot.
.TP 6
\f4\-r\f1
This option indicates the current
.I run-level
of the
\f4init\fP
process.
In addition,
it produces the
process termination status, process id, and process exit status
[see
\f4utmp\fP(4)]
under the
.IR idle ,
.IR pid ,
and
.I comment
headings, respectively.
.TP 6
\f4\-t\f1
This option indicates the last
change to the system clock (via the
\f4date\fP
command) by
\f4root\f1.
See
\f4su\fP(1M).
.TP 6
\f4\-a\f1
This option processes
\f4/var/adm/utmp\f1
or the named
.I file
with all options turned on.
.TP 6
\f4\-s\f1
This option is the default and lists only the
.IR name ,
\f4line\fP,
and
.I time
fields.
.TP 6
\f4\-n \f2x\f1
This option takes a numeric argument, \f2x\f1, which specifies
the number of users to display per line.
\f2x\f1 must be at least \f41\f1.
The \-n option must be used with \-q.
.PP
Note to the super-user:
after a shutdown to the single-user state,
\f4who\f1
returns a prompt;
the reason is that since
\f4/var/adm/utmp\f1
is updated at login time and
there is no login in single-user state,
\f4who\f1
cannot report accurately on this state.
\f4who am i\f1, however,
returns the correct information.
.SH FILES
\f4/var/adm/utmp
.br
/var/adm/wtmp
.br
/sbin/inittab\f1
.SH "SEE ALSO"
\f4date\fP(1),
\f4login\fP(1),
\f4mesg\fP(1),
\f4su\fP(1M).
.br
\f4init\fP(1M), \f4inittab\fP(4), \f4utmp\fP(4) in the \f2System Administrator's Reference
Manual\f1.
.br
\f4wait\fP(2)
in the \f2Programmer's Reference Manual\f1.
.\"	@(#)who.1	6.2 of 9/2/83
.Ee
