Who (Unix)
Encyclopedia
The standard Unix
command who displays a list of users who are currently logged into a computer.
The who command is related to the command w
, which provides the same information but also displays additional data and statistics.
(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 who.
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 tty
and the -m option below, of which this invocation is equivalent).
Other Unix and Unix-like
operating systems may add extra options. GNU
who 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
who and BSD who both omit a number of the above options (such as -a, -b, -d, and others); GNU
who instead uses -l to perform DNS lookups on hostnames listed.
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...
command who displays a list of users who are currently logged into a computer.
The who command is related to the command w
W (Unix)
The command w on many Unix-like operating systems provides a quick summary of every user logged into a computer, what that user is currently doing, and what load all the activity is imposing on the computer itself...
, which provides the same information but also displays additional data and statistics.
Specification
The Single Unix SpecificationSingle UNIX Specification
The Single UNIX Specification is the collective name of a family of standards for computer operating systems to qualify for the name "Unix"...
(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 who.
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 tty
Tty (Unix)
tty is a Unix command that prints to standard output the name of the terminal connected to standard input. The name of the program comes from teletypewriter, abbreviated "TTY".When the program runs, it will output something like this:$ tty/dev/pts/4...
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 processes 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 utility
- -r, show runlevel of the init 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
Unix-like
A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....
operating systems may add extra options. GNU
GNU
GNU is a Unix-like computer operating system developed by the GNU project, ultimately aiming to be a "complete Unix-compatible software system"...
who 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
GNU is a Unix-like computer operating system developed by the GNU project, ultimately aiming to be a "complete Unix-compatible software system"...
who and BSD who both omit a number of the above options (such as -a, -b, -d, and others); GNU
GNU
GNU is a Unix-like computer operating system developed by the GNU project, ultimately aiming to be a "complete Unix-compatible software system"...
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.External links
- who — specification from the Single Unix Specification
- who — manual page from GNUGNUGNU is a Unix-like computer operating system developed by the GNU project, ultimately aiming to be a "complete Unix-compatible software system"...
coreutils - who — manual page from OpenBSDOpenBSDOpenBSD is a Unix-like computer operating system descended from Berkeley Software Distribution , a Unix derivative developed at the University of California, Berkeley. It was forked from NetBSD by project leader Theo de Raadt in late 1995...