Syntax of `w` command in Linux
w [options] user [...]
The output includes the following columns:
Columns |
Description |
---|---|
USER |
Displays the username of the logged-in user. |
TTY |
Shows the terminal device associated with the user session. |
FROM |
Indicates the remote host or IP address the user is connected to |
LOGIN@ |
Displays the time at which the user logged in. |
IDLE |
Shows the duration of inactivity since the user’s last interaction. |
JCPU |
Represents the CPU time used by all processes attached to the user’s session. |
PCPU |
Displays the percentage of CPU time used by the user’s current process. |
WHAT |
WHAT: Provides information about the command or process running in the user’s session. |
w command in Linux with Examples
The ‘w’ command in Linux gives us important information about who is currently using the computer, how much the computer is being used, and what programs are running. It’s a handy tool for people who take care of computer systems, as it helps them keep an eye on what users are doing, how much of the computer’s power is being used, and how to make everything run smoothly.