w command displaying who is logged in in unix system with proccess running by their. 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.

Usage

w [options] [user]

Avaliable Options
-h skip header
-l long listing (default)
-s short listing
-u ignore uid of processes
-f toggle FROM field (default on)
-V display version
Example Command

To check who user logged in with default option, just press w.

w

Sample Output :

root@ssh9 [~]# w
 21:33:12 up 8 days, 21:36,  1 user,  load average: 0.70, 0.68, 0.89
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
root     pts/0    182.11.140.140   21:33    0.00s  0.00s  0.00s w

Use option -h to skip the header.

w -h

Sample Output :

root@ssh9 [~]# w -h
root     pts/0    182.11.140.140   21:33    0.00s  0.00s  0.00s w -h

To check user root with short listing use :

w -s root

Sample Output :

root@ssh9 [~]# w -s root
 21:38:15 up 8 days, 21:41,  1 user,  load average: 0.95, 0.81, 0.87
USER     TTY      FROM               IDLE WHAT
root     pts/0    182.11.140.140    1.00s w -s root

Check version :

w -V

Sample Output :

root@ssh9 [~]# w -V
procps version 3.2.7

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>