who –Command Explained

who –Command Explained

by -
1 758

who command shows  following basic information

  • Who is logged in  now ?
  • Location (IP Address of the user )
  • System booting status
  • Runlevel status of the machine

Examples:

[root@localhost ~]# who
root     tty1         2016-07-29 21:30
root     pts/0        2016-07-29 21:31 (192.168.0.155)
vikas    pts/1        2016-07-29 23:16 (192.168.0.155)
root     pts/2        2016-07-29 23:16 (192.168.0.155)
[root@localhost ~]#

Note :  who command does not show switch user login

where :

Column 1 :   User Name
Column 2:   location  ( terminals )
Column 3:   Date , Time , IP Address

Show only username and no of users logged in

[root@localhost ~]# who -q
root root vikas root
# users=4
[root@localhost ~]#

Check when is the system last time rebooted.

[root@localhost ~]# who -b
system boot  2016-07-29 21:29
[root@localhost ~]#

Show runlevel status of Machine

[root@localhost ~]# who -r
run-level 3  2016-07-29 21:29
[root@localhost ~]#

Show All

[root@localhost ~]# who -a
system boot  2016-07-29 21:29        <———————boot time
run-level 3  2016-07-29 21:29          <———————- run level
root     + tty1         2016-07-29 21:30 01:56        1537
LOGIN      tty2         2016-07-29 21:30              1539 id=2     <—————-TTY status
LOGIN      tty3         2016-07-29 21:30              1541 id=3
LOGIN      tty4         2016-07-29 21:30              1545 id=4
LOGIN      tty5         2016-07-29 21:30              1549 id=5
LOGIN      tty6         2016-07-29 21:30              1553 id=6
root     + pts/0        2016-07-29 21:31   .          1663 (192.168.0.155) <————remote sessions
vikas    + pts/1        2016-07-29 23:16 00:10        5233 (192.168.0.155)
root     + pts/2        2016-07-29 23:16 00:03        5265 (192.168.0.155)
[root@localhost ~]#

Note : For more info  you may use command          who –help  or  man who

Who command doesn’t show you, who is doing what ?, for that you should use w command instead

 

Enjoy Linux !!

CEO, KV IT-Solutions Pvt. Ltd. | vikas@kvit.in | 9810028374|
Linux Professional and an Industrial Trainer | 20 + years Experience in IT Industry

” We are born free, No Gate and Windows can snatch our freedom “

Download PDF

SIMILAR ARTICLES

0 1123

0 789

1 COMMENT

Leave a Reply

Required Captcha *