Find Logged On User in UNIX & Linux

The command who is to show who is logged on in the UNIX/Linux operating system.

1. Show logged user.

# who
root     pts/0        May 17 09:26
root     pts/2        May 17 09:27
root     pts/3        May 17 09:27
root     pts/1        May 24 18:05 (10.3.100.100)
itsiti   pts/8        May 19 15:12
root     pts/10       May 19 15:25
orauser  pts/12       May 19 15:26

2. Show logged user with print line of column headings.

# who -H
NAME     LINE         TIME         COMMENT
root     pts/0        May 17 09:26
root     pts/2        May 17 09:27
root     pts/3        May 17 09:27
root     pts/1        May 24 18:05 (10.3.100.100)
itsiti   pts/8        May 19 15:12
root     pts/10       May 19 15:25
orauser  pts/12       May 19 15:26

3. Show logged user with idle status.

# who -u
root     pts/0        May 17 09:26  old         7439
root     pts/2        May 17 09:27  old         7550
root     pts/3        May 17 09:27  old         7675
root     pts/1        May 24 18:05   .          9068 (10.3.100.100)
itsiti   pts/8        May 19 15:12  old        21441
root     pts/10       May 19 15:25  old        27444
orauser  pts/12       May 19 15:26  old        27898

4. Show logged user with print only name, line, and time (default).

# who -s
root     pts/0        May 17 09:26
root     pts/2        May 17 09:27
root     pts/3        May 17 09:27
root     pts/1        May 24 18:05 (10.3.100.100)
itsiti   pts/8        May 19 15:12
root     pts/10       May 19 15:25
orauser  pts/12       May 19 15:26

5. Show logged user with print system login processes.

# who -l
LOGIN    tty1         May 17 09:27             12255 id=1
LOGIN    tty2         May 17 09:27             12256 id=2
LOGIN    tty3         May 17 09:27             12257 id=3
LOGIN    tty4         May 17 09:27             12258 id=4
LOGIN    tty5         May 17 09:27             12259 id=5
LOGIN    tty6         May 17 09:27             12260 id=6

6. Show logged user with print dead processes.

# who -d
 pts/5        May 16 10:33             24003 id=ts/5  term=0 exit=0
 pts/8        May 17 12:03             15266 id=ts/8  term=0 exit=0
 pts/5        Feb 25 07:13              8139 id=/5    term=0 exit=0
 pts/9        Mar 23 04:27             20043 id=ts/9  term=0 exit=0
 pts/13       May 19 16:38             30107 id=/13   term=0 exit=0
 pts/9        Dec 31 22:45             15484 id=/9    term=0 exit=0
 pts/13       Dec 31 21:49              7386 id=s/13  term=0 exit=0
 pts/14       Dec 31 21:49             12631 id=s/14  term=0 exit=0
 pts/15       May 20 14:26             24662 id=s/15  term=0 exit=0
 pts/1        Apr 25 11:49             21311 id=/1    term=0 exit=0
 :0           May  3 13:43                 0 id=:0    term=0 exit=0

You May Also Like

Leave a Reply?