LinuxCommandLibrary

who

Show who is logged on

TLDR

Display the username, line, and time of all currently logged-in sessions

$ who
copy

Display all available information
$ who [[-a|--all]]
copy

Display all available information with table headers
$ who [[-aH|--all --heading]]
copy

SYNOPSIS

who [OPTION]... [FILE] [am i]

PARAMETERS

-a, --all
    Equivalent to -b -d --login -p -r -t -T -u

-b, --boot
    Time of last system boot

-d, --dead
    List dead processes

-H, --heading
    Print column headers

-i, --idle
    Add idle time in hours and minutes

-l, --login
    List system login processes

-m
    Only hostname and user associated with stdin

-n, --count=N
    List at most N users

-p, --process
    List active processes spawned by init

-q, --count
    List all login names and the number of users logged on

-r, --runlevel
    Current runlevel

-s, --short
    List only name, line, and time

-t, --time
    Show last system clock change

-T, -w, --mesg
    Add message status as +, - or ?

-u, --users
    List users logged in

--message-format=FORMAT
    Use FORMAT when reporting user's message status

--version
    Output version information and exit

--help
    Display this help and exit

am i
    Equivalent to 'who am i'

DESCRIPTION

The who command is a fundamental utility that provides information about users currently logged into the system. It displays details such as the user's login name, terminal line, login time, and the remote host if applicable.

Who is invaluable for system administrators and users alike who need to monitor system activity and determine who is actively using the system's resources. The command can also provide information about system boot time, runlevel, and other system-related events.

Its versatility is further enhanced by numerous options, allowing for tailored output to meet specific needs, from a simple list of users to a more detailed report on system events.

FILE ARGUMENT

If FILE is specified, who uses that file instead of /var/run/utmp or /var/log/wtmp. Given as an argument, the am i option finds the corresponding entry in the file.

HISTORY

The who command is one of the oldest utilities in Unix-like operating systems. It has been present since the earliest versions of Unix and has remained a core part of the system administration toolkit.

Originally, it provided a simple way to determine who was logged into the system, which was essential for communication and resource management in multi-user environments. Over time, the command has evolved with the addition of various options to provide more detailed system information.

SEE ALSO

w(1), users(1), last(1), ps(1), uptime(1)

Copied to clipboard