$linuxjunkies
>

who(1)

Display information about users currently logged in to the system.

UbuntuDebianFedoraArch

Synopsis

who [OPTION]... [FILE]

Description

The who command shows a list of all users currently logged into the system by reading the /var/run/utmp file (or a specified FILE). For each user, it displays their login name, terminal device, login time, and remote hostname if applicable.

This is useful for system administrators to monitor active sessions, check login times, and identify idle users or potential unauthorized access.

Common options

FlagWhat it does
-aShow all information (same as -b -d --login -p -r -t -T -u)
-bShow time of last system boot
-dShow dead processes
-HPrint column headers (LOGIN, TTY, TIME, HOST)
-lShow login processes
-qQuick mode: only print usernames and count
-rShow runlevel
-sShort format: login name, terminal, login time (default)
-TShow terminal status (+ writable, - not writable, ? unknown)
-uShow idle time and process ID (PID)

Examples

Display all currently logged-in users with basic information

who

Show logged-in users with column headers for clarity

who -H

Quick listing showing only usernames and a count of total users

who -q

Display users with their idle time and process IDs

who -u

Show when the system was last booted

who -b

Check login history from the wtmp file instead of current utmp

who /var/log/wtmp

Display information about the current user's session only

who am i

Show comprehensive information including boot time, dead processes, and run level

who -a

Related commands