w Command Cheat Sheet
w shows who is logged on and what they are doing.
Synopsis
w [options] [user]
Basic Usage
w
Output Breakdown:
1. Header: Current time, uptime, users, load average (same as uptime).
2. User Table:
- USER: Login name.
- TTY: Terminal name (pts/0).
- FROM: Remote host IP.
- LOGIN@: Login time.
- IDLE: Idle time.
- JCPU: Time used by all processes attached to the tty.
- PCPU: Time used by the current process (in WHAT column).
- WHAT: The command currently running.
Options
No Header (-h)
Suppress the header (useful for scripts).
w -h
Short Format (-s)
Omit the login time, JCPU, and PCPU times.
w -s
Check Specific User
w john
Notes
- Privacy:
wreveals what other users are running on the system.