Learn the Linux Command - who

Use 'who' to identify logged-in users

The Linux command who returns a list of all logged-in users.

linux who

Synopsis

The command takes the following format:

who [OPTION]... [ FILE | ARG1 ARG2 ]  

Options

The who command takes the following command switches:

  • -a--all: Same as -b -d --login -p -r -t -T -u
  • -b--boot: Time of last system boot
  • -d--dead: Print dead processes
  • -H--heading: Print line of column headings
  • -i--idle: Add idle time as HOURS:MINUTES, . or old (deprecated, use -u)
  • --login: Print system login processes (equivalent to SUS -l)
  • -l--lookup: Attempt to canonicalize hostnames via DNS (-l is deprecated, use --lookup)
  • -m: Only hostname and user associated with stdin
  • -p--process: Print active processes spawned by init
  • -q--count: All login names and number of users logged on
  • -r--runlevel: Print current runlevel
  • -s--short: Print only name, line, and time (default)
  • -t--time: Print last system clock change
  • -T-w--mesg: Add user's message status as +, - or ?
  • -u--users: List users logged in
  • --message: Same as -T
  • --writable: Same as -T
  • --help: Display this help and exit
  • --version: Output version information and exit

If FILE is not specified, the command assumes /var/run/utmp.

Use the man command (% man) to see how a command is used on your particular computer.