w command in Linux Provides a quick summary of every user logged into a computer.
The w
command in Linux provides information about currently logged-in users and their activities. It displays details such as the user’s username, terminal, remote host, login time, idle time, and the current command or process they are running.
On the man page, the describes it
- w – Show who is logged on and what they are doing.
- man w– More details information.
w command in Linux with Examples
$ w
Executing the w
command without any options will display a summary of logged-in users along with their activities. The output will include the following columns:
- USER: The username of the logged-in user.
- TTY: The terminal name or pseudo-terminal associated with the user.
- FROM: The remote host or IP address from which the user is logged in. If the user is logged in locally, this field displays the abbreviation “localhost” or the IP address “127.0.0.1”.
- LOGIN@: The login time of the user.
- IDLE: The idle time, indicating how long the user has been inactive.
- JCPU: The total CPU time used by the user’s processes.
- PCPU: The CPU time used by the user’s current process.
- WHAT: The command or process currently being executed by the user.
Conclusion
w w
command also provides additional options for customized output and filtering based on specific users or terminals.
You can refer to the w command manual (man w
) for more information on these options. Thank you for reading the DevopsRoles page!