Site icon LinuxCommands.site

w command tutorial in linux/unix with examples and use cases

linux w command – Show who is logged on and what they are doing.

The header displays three parts of information:
1. The current time, how long the system has been running.
2. How many users are currently logged on.
3. The system load averages for the past 1, 5, and 15 minutes.

The following entries are displayed for each user:
1. login name
2. the tty name
3. the remote host
4. login time
5. idle time
6. JCPU
7. PCPU
8. The command line of their current process

The JCPU time is the time used by all processes attached to the tty. It does not include past background jobs, but does include currently running background jobs.
The PCPU time is the time used by the current process, named in the “what” field.

Syntax

w [options] user [...]

Options

Related system files

examples

Show current user

➜  ~ w

Do not display header information

➜  ~ w -h

Do not display the from field

➜  ~ w -f 

Display the short format

➜  ~ w -s

Exit mobile version