w
The command line tool "w" is a Unix utility that allows users to view information about currently logged-in users. It provides a snapshot of who is logged in, what they are doing, and other relevant details. When executed, the "w" command displays a list of logged-in users with their username, terminal session, remote host or IP address, login time, idle time, JCPU (the time used by all processes attached to the terminal), PCPU (the time used by the current process), and the command or activity being performed. The idle time indicates the duration of inactivity for each user, providing an estimate of when they last interacted with the system. The "w" command also displays load average values, providing an indication of the system's CPU usage over a specific time period. By default, the "w" command shows details for all logged-in users, but it can also be used to display information for a specific user by specifying the username as an argument. The "w" command relies on data from the "/var/run/utmp" file, which stores information about currently logged-in users and their sessions. The output of the "w" command can be useful in system administration tasks, such as determining user activity, identifying idle sessions, monitoring system performance, or troubleshooting. The "w" command is often used in conjunction with other Unix utilities, such as "who", to gather more detailed information about logged-in users. Overall, the "w" command provides a quick and concise overview of user activity on a Unix system, enabling administrators to manage resources effectively and monitor system usage.
List of commands for w:
-
w:tldr:2c2be w: Display information without including the login, JCPU and PCPU columns.$ w --shorttry on your machineexplain this command
-
w:tldr:4bc4d w: Display information about a specific user.$ w ${username}try on your machineexplain this command
-
w:tldr:824b0 w: Display information without including the header.$ w --no-headertry on your machineexplain this command
-
w:tldr:c6a9e w: Show info about logged-in users, sorted by their idle time.$ w -itry on your machineexplain this command
-
w:tldr:e7c57 w: Show logged-in users info without a header.$ w -htry on your machineexplain this command