who Command Cheat Sheet
who displays information about users who are currently logged in.
Synopsis
who [OPTION]... [ FILE | ARG1 ARG2 ]
Basic Usage
who
# Output lines:
# faruk tty1 2025-12-16 09:00 (:0)
# root pts/0 2025-12-16 10:30 (192.168.1.5)
Options
Show All Information (-a)
Equivalent to -b -d --login -p -r -t -T -u.
who -a
Show Boot Time (-b)
Show the time of last system boot.
who -b
# Output:
# system boot 2025-12-16 08:00
Show Dead Processes (-d)
Print dead processes (zombies/terminated sessions).
who -d
Add Headers (-H)
Print column headers.
who -H
# Output:
# NAME LINE TIME COMMENT
# faruk tty1 2025-12-16 09:00 (:0)
Count Users (-q)
Quick count of total users.
who -q
# Output:
# faruk root
# # users=2
Show Runlevel (-r)
who -r
# Output:
# run-level 5 2025-12-16 08:00
Notes
- Source: Reads
/var/run/utmp. - "Am I" Argument:
who am i(with spaces) acts likewho -m, showing only the hostname and user associated with the standard input (the current terminal).who am i