$linuxjunkies
>

w(1)

Display information about currently logged-in users and their activities.

UbuntuDebianFedoraArch

Synopsis

w [OPTION]... [USER]...

Description

The w command shows who is logged in and what they are doing. It displays a header line with current time, uptime, number of users, and system load averages, followed by a list of logged-in users with details about their terminal, login time, idle time, CPU usage, and current command.

Unlike who, which only shows login information, w displays the actual process each user is running, making it useful for system monitoring and identifying idle or resource-heavy sessions.

Common options

FlagWhat it does
-hOmit the header line (uptime, load average, number of users)
-uIgnore username while figuring out the current process and CPU times
-sUse short output format (omit login time, JCPU, PCPU)
-fToggle printing the from (remote hostname) field
-iPrint IP address instead of hostname for remote login
-pShow only processes matching a specific pattern
-VDisplay version information and exit

Examples

Display all logged-in users with full details including current processes

w

Show user list without the header (uptime and load averages)

w -h

Show short format output with minimal columns (no login time or CPU usage)

w -s

Display information only for user 'john'

w john

Show IP addresses instead of hostnames for remote connections

w -i

Ignore username when determining process ownership and CPU times

w -u

Related commands