List Logged-in Users and Their Commands with w
The w command combines uptime and who with a per-user 'what are they running' column, perfect for shared servers.
01Command
$ w02What it does
Many people know `who` but forget `w`, which is strictly more informative: the header repeats uptime and load averages, while each row shows USER, TTY, login time, IDLE, and the WHAT column with the current process. Use `w -h` to drop the header, or `w user` to filter to one account. It is ideal before rebooting a shared box to confirm nobody is mid-command.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- w(1) - show who is logged on and what they are doingEvidence: w displays information about the users currently on the machine, and their processes; the header shows uptime and load, and the body lists each user's current JCPU/PCPU and WHAT command.
Last verified: 2026-09-17 · Category: System & Settings
06Related solutions
Use free -h to see used, free, and available memory plus swap in GB/MiB instead of raw kilobytes.
vmstat gives a compact one-line-per-interval view of CPU usage, swap activity, and I/O waits that top doesn't summarize as clearly.
loginctl lists active sessions and users on a systemd system and can terminate a hung session through systemd-logind.