Linux w Command: Show Logged-In Users and Their Processes
w shows the currently logged-in users and each session's terminal, idle time, and running tasks. It is used to look more closely at the current activity of sessions than who.
What is the w command?
The first line of the output shows the current time, uptime, number of logged-in users, and system load averages. The rows below show each user's terminal and the current task in the WHAT column. Columns may vary depending on the procps-ng implementation and configuration of the distribution.
Basic syntax
w [option] [user]
The installed implementation and options may vary by distribution. Use man w to check the description for the current system.
Examples
Viewing all sessions
Check who is logged in and what they are doing on which terminal.
w
Viewing a specific user
If you provide a username as an argument, you can focus on that user's sessions.
w alice
Print without header
Used when you want to check only the rows per user.
w -h
Reading sessions and running tasks
The upper part of w shows system uptime and load averages, and the lower part shows terminals per logged-in user and their current tasks.
w -h
Example output (values and column widths may vary depending on the environment):
alice pts/0 192.0.2.10 09:00 2:10 0.01s 0.01s vim notes.txt
-h hides only the top header, leaving the user rows. IDLE is the time there has been no input for that terminal, and WHAT summarizes the command being run in that session. Since it uses login records, in containers or some sessions the actual activity and the list may not match.
Main Options and Format
| Options/Format | Description |
|---|---|
-h |
Hides the header of the first line. |
-s |
Prints in a concise format. |
-f |
Turns the display of the remote host column on or off. |
-i |
Displays the remote host as an IP address if possible. |
Precautions when using
The WHAT column is only a snapshot of the tasks associated with the current session and not a list of all background processes. JCPU and PCPU are CPU times of different scopes. In containers without login records, information may be insufficient, similar to who.
Frequently Asked Questions
Which one should I use, w or who?
A simple list of connected users, terminals, and login times can be obtained with who, and w is suitable if you want to see the current work along with idle time.
Official Documentation
The exact behavior of the options and differences between implementations can be found in the official documentation related to w.









