All rights reserved, please indicate the source when citing
w - Display User Information
The w command, which stands for "show who is logged on and what they are doing," provides information about users currently logged into the system and their activities. You can use it to see who is logged in, what processes they are running, and more. It can also be used to specifically check information for a particular user.
The syntax of the w command is as follows:
w [OPTIONS] .
In most cases, you don't need to specify any options.
Example:
$ w daisy
03:51:14 up 52 min, 3 users, load average: 0.19, 0.09, 0.10
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
daisy tty2 03:50 10.00s 0.09s 0.04s vim seq.cpp |
The output includes the following information
- The first line displays the current system time, system uptime, the number of logged-in users, and the system's average load.
- Subsequent lines display detailed information about each logged-in user, including their username, login terminal (TTY), remote host address (if applicable), login time, idle time, CPU usage time, and the currently running command.
The w command is useful for monitoring and understanding user activity and processes on a system, especially in multi-user environments. You can press the "q" key to exit the w command's output.
For more examples and explanations, you can refer to the provided link.