who.1p (9986B)
- '\" et
- .TH WHO "1P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
- .\"
- .SH PROLOG
- This manual page is part of the POSIX Programmer's Manual.
- The Linux implementation of this interface may differ (consult
- the corresponding Linux manual page for details of Linux behavior),
- or the interface may not be implemented on Linux.
- .\"
- .SH NAME
- who
- \(em display who is on the system
- .SH SYNOPSIS
- .LP
- .nf
- who \fB[\fR-mTu\fB] [\fR-abdHlprt\fB] [\fIfile\fB]\fR
- .P
- who \fB[\fR-mu\fB] \fR-s\fB [\fR-bHlprt\fB] [\fIfile\fB]\fR
- .P
- who -q \fB[\fIfile\fB]\fR
- .P
- who am i
- .P
- who am I
- .fi
- .SH DESCRIPTION
- The
- .IR who
- utility shall list various pieces of information about accessible
- users. The domain of accessibility is implementation-defined.
- .P
- Based on the options given,
- .IR who
- can also list the user's name, terminal line, login time, elapsed time
- since activity occurred on the line, and the process ID of the command
- interpreter for each current system user.
- .SH OPTIONS
- The
- .IR who
- utility shall conform to the Base Definitions volume of POSIX.1\(hy2017,
- .IR "Section 12.2" ", " "Utility Syntax Guidelines".
- .P
- The following options shall be supported. The metavariables, such as
- <\fIline\fP>, refer to fields described in the STDOUT section.
- .IP "\fB\-a\fP" 10
- Process the implementation-defined database or named file with the
- .BR \-b ,
- .BR \-d ,
- .BR \-l ,
- .BR \-p ,
- .BR \-r ,
- .BR \-t ,
- .BR \-T
- and
- .BR \-u
- options turned on.
- .IP "\fB\-b\fP" 10
- Write the time and date of the last system reboot. The system reboot
- time is the time at which the implementation is able to commence
- running processes.
- .IP "\fB\-d\fP" 10
- Write a list of all processes that have expired and not been respawned
- by the
- .IR init
- system process. The <\fIexit\fP> field shall appear for dead processes
- and contain the termination and exit values of the dead process. This
- can be useful in determining why a process terminated.
- .IP "\fB\-H\fP" 10
- Write column headings above the regular output.
- .IP "\fB\-l\fP" 10
- (The letter ell.) List only those lines on which the system is waiting
- for someone to login. The <\fIname\fP> field shall be
- .BR LOGIN
- in such cases. Other fields shall be the same as for user entries
- except that the <\fIstate\fP> field does not exist.
- .IP "\fB\-m\fP" 10
- Output only information about the current terminal.
- .IP "\fB\-p\fP" 10
- List any other process that is currently active and has been previously
- spawned by
- .IR init .
- .IP "\fB\-q\fP" 10
- (Quick.) List only the names and the number of users currently logged
- on. When this option is used, all other options shall be ignored.
- .IP "\fB\-r\fP" 10
- Write the current
- .IR run-level
- of the
- .IR init
- process.
- .IP "\fB\-s\fP" 10
- List only the <\fIname\fR>, <\fIline\fR>, and <\fItime\fR> fields.
- This is the default case.
- .IP "\fB\-t\fP" 10
- Indicate the last change to the system clock.
- .IP "\fB\-T\fP" 10
- Show the state of each terminal, as described in the STDOUT section.
- .IP "\fB\-u\fP" 10
- Write ``idle time'' for each displayed user in addition to any other
- information. The idle time is the time since any activity occurred on
- the user's terminal. The method of determining this is unspecified.
- This option shall list only those users who are currently logged in.
- The <\fIname\fP> is the user's login name. The <\fIline\fP> is the name
- of the line as found in the directory
- .BR /dev .
- The <\fItime\fP> is the time that the user logged in. The
- <\fIactivity\fP> 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 shall be marked <\fIold\fP>. This field is useful
- when trying to determine whether a person is working at the terminal or
- not. The <\fIpid\fP> is the process ID of the user's login process.
- .SH OPERANDS
- The following operands shall be supported:
- .IP "\fBam\ i\fR,\ \fBam\ I\fR" 10
- In the POSIX locale, limit the output to describing the invoking user,
- equivalent to the
- .BR \-m
- option. The
- .BR am
- and
- .BR i
- or
- .BR I
- must be separate arguments.
- .IP "\fIfile\fR" 10
- Specify a pathname of a file to substitute for the
- implementation-defined database of logged-on users that
- .IR who
- uses by default.
- .SH STDIN
- Not used.
- .SH "INPUT FILES"
- None.
- .SH "ENVIRONMENT VARIABLES"
- The following environment variables shall affect the execution of
- .IR who :
- .IP "\fILANG\fP" 10
- Provide a default value for the internationalization variables that are
- unset or null. (See the Base Definitions volume of POSIX.1\(hy2017,
- .IR "Section 8.2" ", " "Internationalization Variables"
- for the precedence of internationalization variables used to determine
- the values of locale categories.)
- .IP "\fILC_ALL\fP" 10
- If set to a non-empty string value, override the values of all the
- other internationalization variables.
- .IP "\fILC_CTYPE\fP" 10
- Determine the locale for the interpretation of sequences of bytes of
- text data as characters (for example, single-byte as opposed to
- multi-byte characters in arguments).
- .IP "\fILC_MESSAGES\fP" 10
- .br
- Determine the locale that should be used to affect the format and
- contents of diagnostic messages written to standard error.
- .IP "\fILC_TIME\fP" 10
- Determine the locale used for the format and contents of the date and
- time strings.
- .IP "\fINLSPATH\fP" 10
- Determine the location of message catalogs for the processing of
- .IR LC_MESSAGES .
- .IP "\fITZ\fP" 10
- Determine the timezone used when writing date and time information. If
- .IR TZ
- is unset or null, an unspecified default timezone shall be used.
- .SH "ASYNCHRONOUS EVENTS"
- Default.
- .SH STDOUT
- The
- .IR who
- utility shall write its default format to the standard output in an
- implementation-defined format, subject only to the requirement of
- containing the information described above.
- .P
- XSI-conformant systems shall write the default information to the
- standard output in the following general format:
- .sp
- .RS 4
- .nf
- <\fIname\fR>\fB[\fR<\fIstate\fR>\fB]\fR<\fIline\fR><\fItime\fR>\fB[\fR<\fIactivity\fR>\fB][\fR<\fIpid\fR>\fB][\fR<\fIcomment\fR>\fB][\fR<\fIexit\fR>\fB]\fR
- .fi
- .P
- .RE
- .P
- For the
- .BR \-b
- option, <\fIline\fP> shall be
- .BR \(dqsystem boot\(dq .
- The <\fIname\fP> is unspecified.
- .P
- The following format shall be used for the
- .BR \-T
- option:
- .sp
- .RS 4
- .nf
- "%s %c %s %s\en" <\fIname\fR>, <\fIterminal state\fR>, <\fIterminal name\fR>,
- <\fItime of login\fR>
- .fi
- .P
- .RE
- .P
- where <\fIterminal\ state\fP> is one of the following characters:
- .IP "\fR+\fR" 8
- The terminal allows write access to other users.
- .IP "\fR\-\fR" 8
- The terminal denies write access to other users.
- .IP "\fR?\fR" 8
- The terminal write-access state cannot be determined.
- .IP "\fR<space>\fR" 8
- This entry is not associated with a terminal.
- .P
- In the POSIX locale, the <\fItime\ of\ login\fP> shall be equivalent in
- format to the output of:
- .sp
- .RS 4
- .nf
- date +"%b %e %H:%M"
- .fi
- .P
- .RE
- .P
- If the
- .BR \-u
- option is used with
- .BR \-T ,
- the idle time shall be added to the end of the previous format in an
- unspecified format.
- .SH STDERR
- The standard error shall be used only for diagnostic messages.
- .SH "OUTPUT FILES"
- None.
- .SH "EXTENDED DESCRIPTION"
- None.
- .SH "EXIT STATUS"
- The following exit values shall be returned:
- .IP "\00" 6
- Successful completion.
- .IP >0 6
- An error occurred.
- .SH "CONSEQUENCES OF ERRORS"
- Default.
- .LP
- .IR "The following sections are informative."
- .SH "APPLICATION USAGE"
- The name
- .IR init
- used for the system process is the most commonly used on historical
- systems, but it may vary.
- .P
- The ``domain of accessibility'' referred to is a broad concept that
- permits interpretation either on a very secure basis or even to allow a
- network-wide implementation like the historical
- .IR rwho .
- .SH EXAMPLES
- None.
- .SH RATIONALE
- Due to differences between historical implementations, the base options
- provided were a compromise to allow users to work with those
- functions. The standard developers also considered removing all the
- options, but felt that these options offered users valuable
- functionality. Additional options to match historical systems are
- available on XSI-conformant systems.
- .P
- It is recognized that the
- .IR who
- command may be of limited usefulness, especially in a multi-level
- secure environment. The standard developers considered, however, that
- having some standard method of determining the ``accessibility'' of
- other users would aid user portability.
- .P
- No format was specified for the default
- .IR who
- output for systems not supporting the XSI option. In such a
- user-oriented command, designed only for human use, this was not
- considered to be a deficiency.
- .P
- The format of the terminal name is unspecified, but the descriptions of
- .IR ps ,
- .IR talk ,
- and
- .IR write
- require that they use the same format.
- .P
- It is acceptable for an implementation to produce no output for
- an invocation of
- .IR who
- .BR mil .
- .SH "FUTURE DIRECTIONS"
- None.
- .SH "SEE ALSO"
- .IR "\fImesg\fR\^"
- .P
- The Base Definitions volume of POSIX.1\(hy2017,
- .IR "Chapter 8" ", " "Environment Variables",
- .IR "Section 12.2" ", " "Utility Syntax Guidelines"
- .\"
- .SH COPYRIGHT
- Portions of this text are reprinted and reproduced in electronic form
- from IEEE Std 1003.1-2017, Standard for Information Technology
- -- Portable Operating System Interface (POSIX), The Open Group Base
- Specifications Issue 7, 2018 Edition,
- Copyright (C) 2018 by the Institute of
- Electrical and Electronics Engineers, Inc and The Open Group.
- In the event of any discrepancy between this version and the original IEEE and
- The Open Group Standard, the original IEEE and The Open Group Standard
- is the referee document. The original Standard can be obtained online at
- http://www.opengroup.org/unix/online.html .
- .PP
- Any typographical or formatting errors that appear
- in this page are most likely
- to have been introduced during the conversion of the source files to
- man page format. To report such errors, see
- https://www.kernel.org/doc/man-pages/reporting_bugs.html .