Who (Unix)

Unix command

who

The `who` command

Developer(s)| AT&T Bell Laboratories
Initial release| November 3, 1971; 53 years ago (1971-11-03)
Operating system| Multics, Unix, Unix-like, Plan 9
Platform| Cross-platform
Type| Command
License| coreutils: GPLv3+

The standard Unix command `who` displays a list of users who are currently logged into the computer.

The `who` command is related to the command w, which provides the same information but also displays additional data and statistics.

## History

[edit]

A `who` command that displays the names of users logged in was first implemented for the CTSS operating system by Noel Morris in 1965. This inspired Tom Van Vleck to write a Multics version.[1][2] Later, it appeared in Version 1 Unix[3] and became part of the X/Open Portability Guide since issue 2 of 1987. It was inherited by the first version of POSIX.1 and the Single Unix Specification.

The existence of `who` presupposes the existence of an online group of users in a shared collegial environment with a need to communicate with each other.[1]

The version of `who` bundled in GNU coreutils was written by Joseph Arceneaux, David MacKenzie, and Michael Stone.[4]

## Specification

[edit]

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 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).

## Usage

[edit]

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 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.

## Output

[edit]

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

[edit]

* List of Unix commands

## References

[edit]

1. ^ a b Van Vleck, Tom (September 8, 1997). "The who command". Retrieved May 1, 2025.
2. ^ `who` – Shell and Utilities Reference, The Single UNIX Specification, Version 5 from The Open Group
3. ^ `who(1)` – FreeBSD General Commands Manual
4. ^ `who(1)` – Linux User Manual – User Commands

## External links

[edit]

The Wikibook Guide to Unix has a page on the topic of: Commands

* `who` – Shell and Utilities Reference, The Single UNIX Specification, Version 5 from The Open Group
* who — manual page from GNU coreutils
* `who(1)` – OpenBSD General Commands Manual
* `who(1)` – Plan 9 Programmer's Manual, Volume 1

* v
* t
* e

Unix command-line interface programs and shell builtins

File system|

* cat
* chattr
* chmod
* chown
* chgrp
* cksum
* cmp
* cp
* dd
* du
* df
* file
* fuser
* ln
* ls
* mkdir
* mv
* pax
* pwd
* rm
* rmdir
* split
* tee
* touch
* type
* umask

Processes|

* at
* bg
* crontab
* fg
* kill
* nice
* ps
* time

User environment|

* env
* exit
* logname
* mesg
* talk
* tput
* uname
* who
* write

Text processing|

* awk
* basename
* comm
* csplit
* cut
* diff
* dirname
* ed
* ex
* fold
* head
* iconv
* join
* m4
* more
* nl
* paste
* patch
* printf
* read
* sed
* sort
* strings
* tail
* tr
* troff
* uniq
* vi
* wc
* xargs

Shell builtins|

* alias
* cd
* echo
* test
* unset
* wait

Searching|

* find
* grep

Documentation|

* man

Software development|

* ar
* ctags
* lex
* make
* nm
* strip
* yacc

Miscellaneous|

* bc
* cal
* expr
* lp
* od
* sleep
* true and false

* Categories
* Standard Unix programs
* Unix SUS2008 utilities
* List

* v
* t
* e

Plan 9 command-line interface programs and shell builtins

File system|

* chmod
* chgrp
* cmp
* cp
* dd
* du
* file
* gzip
* ls
* mkdir
* pwd
* rm
* split
* tee
* touch

Processes|

* kill
* ps

User environment|

* passwd
* who

Text processing|

* awk
* basename
* comm
* diff
* ed
* eqn
* join
* sed
* sort
* spell
* strings
* tail
* tr
* troff
* uniq
* wc

Shell builtins|

* echo
* test

Networking|

* ip/ipconfig
* ip/ping
* netstat

Searching|

* grep

Software development|

* ar
* hoc
* lex
* nm
* strip
* yacc

Miscellaneous|

* bc
* cal
* fortune
* sleep

* Category

* v
* t
* e

GNU Core Utilities command-line interface programs

File system|

* chcon
* chmod
* chown
* chgrp
* cksum
* cp
* dd
* df
* dir
* dircolors
* install
* ln
* ls
* mkdir
* mkfifo
* mknod
* mktemp
* mv
* realpath
* rm
* rmdir
* shred
* sync
* touch
* truncate
* vdir

Text utilities|

* b2sum
* base32
* base64
* cat
* cksum
* comm
* csplit
* cut
* expand
* fmt
* fold
* head
* join
* md5sum
* nl
* numfmt
* od
* paste
* ptx
* pr
* sha1sum
* shuf
* sort
* split
* sum
* tac
* tail
* tr
* tsort
* unexpand
* uniq
* wc

Shell utilities|

* arch
* basename
* chroot
* date
* dirname
* du
* echo
* env
* expr
* factor
* false
* groups
* hostid
* id
* link
* logname
* nice
* nohup
* nproc
* pathchk
* pinky
* printenv
* printf
* pwd
* readlink
* runcon
* seq
* sleep
* stat
* stdbuf
* stty
* tee
* test
* timeout
* true
* tty
* uname
* unlink
* uptime
* users
* who
* whoami
* yes

*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template