Name

w [username] — procps

Synopsis

/usr/bin stdin stdout - file -- opt --help --version

The w command displays the current process for each logged-in user, or more specifically, for each shell of each user:

$ w
 10:51pm  up 8 days,  3:42,  8 users,
 load average: 0.00, 0.00, 0.00
USER    TTY   FROM  LOGIN@  IDLE   JCPU   PCPU  WHAT
barrett pts/0 :0    Sat 2pm 27:13m 0.07s  0.07s emacs
jones   pts/1 host1 6Sep03   2:33m 0.74s  0.21s bash
smith   pts/2 host2 6Sep03   0.00s 13.35s 0.04s w

The top line is the same one printed by uptime. The columns indicate the user’s terminal, originating host or X display (if applicable), login time, idle time, two measures of the CPU time (run man w for details), and the current process. Provide a username to see only that user’s information.

For the briefest output, try w -hfs.

Useful options

-h

Don’t print the header line.

-f

Don’t print the FROM column.

-s

Don’t print the JCPU and PCPU columns.

Get Linux Pocket Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.