Permissions, users and access

Command who

Show logged in users

Linux · Bash examples · commands run on the selected server

When to use who

Use who to inspect login records while checking who is connected to a server. Its view depends on system accounting and should not be treated as a complete security inventory of every process or connection.

Syntax

who [PARAMETERS]

Square brackets mark optional arguments; an ellipsis means repetition. Replace example file names, user names and server addresses with your own values.

Common options and arguments

-a
Extended information from the login database.
-b
Show the last system boot time.
-H
Add column headings.

Usage examples

Show logged-in sessions

who

Recorded login sessions are listed with their terminal and time information.

Show sessions with column headings

who -H

Column headings are included to clarify the displayed fields.

Show the last system boot time

who -b

The recorded system boot time is shown.

Notes and limitations

  • The data source is usually utmp; containers and thin systems may not maintain such a database.
  • The output is not a complete list of all network connections or processes.

Common questions and troubleshooting

Why is an SSH connection missing from who?

Noninteractive connections and some environments do not create the same login records. Use process and service logs for the relevant investigation.

Does who show every user running a process?

No. Login accounting and process ownership are different sources. Use process tools when you need running-task information.

Further help

Options vary by version and distribution. Check the installed documentation with this command: man who.