System and processes
The who command
Lists who has a session open right now, on which terminal and since when.
Most useful options
-a, --allSame as -b -d --login -p -r -t -T -u: almost everything who can show-b, --bootShows the time of the last system boot-H, --headingAdds the row with the column names-q, --countOnly the login names and how many users are logged on-u, --usersAdds the idle time of each session-t, --timeShows the last change to the system clock-r, --runlevelShows the current runlevelCopy-ready examples
$ whowho is logged in, with terminal and login time.Example output
miguel pts/0 2026-11-06 08:15 (192.168.1.10)
$ who -Hthe same, with the header row on top.$ who | wc -lcounts the open sessions. A user with two terminals counts twice.$ who -uadds the idle column, useful to see who has been away from the keyboard for a while.$ who -btime of the last boot, to know since when the machine has been running.You can try them in the browser terminal: it does not touch your computer.
Common errors
| Message | Cause | Fix |
|---|---|---|
| who: invalid option -- 'Q' | who has no such option. It is easy to mix up with the options of w or last. | Check the valid options with who --help. |
| who: unrecognized option '--todos' | You typed a long option that who does not know, often because of a typo. | Copy the exact option name from who --help. |
Typical mistakes
- who only sees sessions recorded by the system. A background process is not a session and does not appear.
- A user with two terminals open appears twice, one line per session.
- The time shown is the login time, not the last activity. To see idle time, use who -u.
Differences from similar commands
FAQ
How does it differ from whoami?
whoami prints only your own name; who lists every open session.
How do I count the open sessions?
Use who | wc -l, which counts one line per session, or who -q, which also prints the number of users.
What time appears next to each user?
The time that session was opened. If you want to know how long it has been inactive, use who -u.
Learn to actually use it
The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.
Start the free course