- 3,129 hits
Place for playing with commands…
ODOC: About w command
Displays information about the users currently on the machine, and their processes. The header shows, in this order, the current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes.
w [-husfVo] [user]
-h -> Don’t print the header.
-u -> Ignores the username while figuring out the current process and cpu times. To demonstrate this, do a “su” and do a “w” and a “w -u”.
-s -> Use the short format. Don’t print the login time, JCPU or PCPU times.
-f -> Toggle printing the from (remote hostname) field. The default as released is for the from field to not be printed, although your system administrator or distribution maintainer may have compiled a version in which the from field is shown by default.
-V -> Display version information.
-o -> Old style output. Prints blank space for idle times less than one minute.
user -> Show information about the specified user only.
praveen@praveen:~$ w USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT praveen tty7 :0 06:38 48:04 1:37 0.29s gnome-session praveen pts/1 :0.0 07:26 0.00s 0.31s 0.00s w