The standard
Unix
Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
command
who
displays a list of users who are currently logged into the computer.
The
who
command is related to the command , which provides the same information but also displays additional data and statistics.
History
A command that displays the names of users logged in was first implemented within
Multics
Multics ("Multiplexed Information and Computing Service") is an influential early time-sharing operating system based on the concept of a single-level memory.Dennis M. Ritchie, "The Evolution of the Unix Time-sharing System", Communications of t ...
. Later, it appeared in
Version 1 Unix
The term "Research Unix" refers to early versions of the Unix operating system for DEC PDP-7, PDP-11, VAX and Interdata 7/32 and 8/32 computers, developed in the Bell Labs Computing Sciences Research Center (CSRC).
History
The term ''Resear ...
and became part of the
X/Open X/Open group (also known as the Open Group for Unix Systems and incorporated in 1987 as X/Open Company, Ltd.) was a consortium founded by several European UNIX systems manufacturers in 1984 to identify and promote open standards in the field of info ...
Portability Guide since issue 2 of 1987. It was inherited into the first version of POSIX.1 and the
Single Unix Specification.
The version of
who
bundled in
GNU
GNU () is an extensive collection of free software (383 packages as of January 2022), which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operat ...
coreutils
The GNU Core Utilities or coreutils is a package of GNU software containing implementations for many of the basic tools, such as cat, ls, and rm, which are used on Unix-like operating systems.
In September 2002, the ''GNU coreutils'' were cr ...
was written by Joseph Arceneaux, David MacKenzie, and Michael Stone.
Specification
The
Single UNIX Specification (SUS) specifies that
who
should list information about accessible users. The
XSI extension also specifies that the data of the username, terminal, login time, process ID, and time since last activity occurred on the terminal, furthermore, an alternate system database used for user information can be specified as an optional argument to .
The command can be invoked with the arguments
am i
or
am I
(so it is invoked as
who am i
or
who am I
), showing information about the current terminal only (see the command and the
-m
option below, of which this invocation is equivalent).
Usage
The SUS without extensions only specifies the following
-m
,
-T
, and
-u
options, all other options are specified in the XSI extension.
:
-a
, process the system database used for user information with the
-b
,
-d
,
-l
,
-p
,
-r
,
-t
,
-T
and
-u
.
:
-b
, show time when system was last rebooted
:
-d
, show
zombie process
On Unix and Unix-like computer operating systems, a zombie process or defunct process is a process that has completed execution (via the exit system call) but still has an entry in the process table: it is a process in the " Terminated state". Thi ...
es and details
:
-H
, show column headers
:
-l
, show terminals where a user can log in
:
-m
, show information about the current terminal only
:
-p
, show active processes
:
-q
, quick format, show only names and the number of all users logged on, disables all other options; equivalent to users
command line
A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invoking executables and pro ...
utility
:
-r
, show runlevel of the
init
In Unix-based computer operating systems, init (short for ''initialization'') is the first process started during booting of the computer system. Init is a daemon process that continues running until the system is shut down. It is the direct ...
process.
:
-s
, (default) show only name, terminal, and time details
:
-t
, show when system clock was last changed
:
-T
, show details of each terminal in a standard format (see note in Examples section)
:
-u
, show idle time; XSI shows users logged in and displays information whether the terminal has been used recently or not
Other Unix and
Unix-like
A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
operating systems may add extra options.
GNU
GNU () is an extensive collection of free software (383 packages as of January 2022), which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operat ...
includes a
-i
option behaving similarly to
-u
and a
-w
option displaying whether the user listed accepts messages (the SUS displays this when
-T
is specified), yet
GNU
GNU () is an extensive collection of free software (383 packages as of January 2022), which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operat ...
who
and
BSD
The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berk ...
who
both omit a number of the above options (such as
-a
,
-b
,
-d
, and others);
GNU
GNU () is an extensive collection of free software (383 packages as of January 2022), which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operat ...
who
instead uses
-l
to perform DNS lookups on hostnames listed.
Output
The SUS without extensions specifies that the output format is to be "implementation-defined". The XSI extension specifies a format, but notes that it is not fully specified; delimiters and field lengths are not precisely specified. Thus, the format of the output differs considerably among Unix implementations.
See also
*
List of Unix commands
This is a list of Unix commands as specified by IEEE Std 1003.1-2008, which is part of the Single UNIX Specification (SUS). These commands can be found on Unix operating systems and most Unix-like operating systems.
List
See also
* List of G ...
References
External links
*
who—
manual page
A man page (short for manual page) is a form of software documentation usually found on a Unix or Unix-like operating system. Topics covered include computer programs (including library and system calls), formal standards and conventions, and ev ...
from
GNU
GNU () is an extensive collection of free software (383 packages as of January 2022), which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operat ...
coreutils
The GNU Core Utilities or coreutils is a package of GNU software containing implementations for many of the basic tools, such as cat, ls, and rm, which are used on Unix-like operating systems.
In September 2002, the ''GNU coreutils'' were cr ...
*
*
{{Core Utilities commands
Multics commands
Unix user management and support-related utilities
Standard Unix programs
Unix SUS2008 utilities
Plan 9 commands