w – show who is logged in and what they are doing

w command
w command

w shows who is logged in and what they’re doing. It combines information from who and uptime.

Synopsis

w [OPTIONS] [USER]

Examples

Basic output

$ w
 14:30:00 up 7 days,  3:45,  2 users,  load average: 0.15, 0.20, 0.18
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
greys    pts/0    192.168.1.50     10:00    0.00s  0.10s  0.01s w
admin    pts/1    192.168.1.51     13:45    2:30   0.05s  0.01s vim server.conf

Specific user

$ w greys

Short format (no header)

$ w -h
greys    pts/0    192.168.1.50     10:00    0.00s  0.10s  0.01s w

Without “from” column

$ w -f

Output Columns

ColumnDescription
USERUsername
TTYTerminal
FROMRemote host (IP/hostname)
LOGIN@Login time
IDLEIdle time
JCPUCPU time for all processes on this TTY
PCPUCPU time for current process
WHATCurrent command

Header Line

14:30:00 up 7 days,  3:45,  2 users,  load average: 0.15, 0.20, 0.18
│        │              │              │
│        │              │              └─ Load averages (1/5/15 min)
│        │              └─ Number of logged-in users
│        └─ System uptime
└─ Current time

Tips

  • Quick check: w is faster than who + uptime separately
  • Monitor users: Good for seeing what others are doing on shared systems
  • Idle time: Shows who’s actually active vs just logged in
  • Security: Check for unexpected users or sessions

See Also

  • who — Show logged-in users
  • users — Print logged-in user names
  • last — Show login history
  • uptime — System uptime and load

Tutorials