The who command
The who
command lets you print out a list of logged-in users, the current run level of the system and the time of last system boot.
Examples
Print out all details of currently logged-in users
[root@academy ~]# who -a
system boot 2023-12-23 15:22
LOGIN tty1 2023-12-23 15:22 663 id=tty1
run-level 3 2023-12-23 15:22
root + pts/0 2023-12-23 15:25 . 1732 (192.168.73.1)
apa + pts/1 2023-12-23 16:42 00:03 14680 (192.168.73.1)
[root@academy ~]#
Print out the list of all dead processes
[root@academy ~]# who -d -H
NAME LINE TIME IDLE PID COMMENT EXIT
pts/1 2023-12-23 16:47 14680 id=ts/1 term=0 exit=0
Syntax:
who [options] [filename]
Additional Flags and their Functionalities
Short Flag
Description
-r
prints all the current runlevel
-d
print all the dead processes
-q
print all the login names and total number of logged on users
-h
print the heading of the columns displayed
-b
print the time of last system boot
[root@academy ~]# who -r
run-level 3 2023-12-23 15:22
[root@academy ~]# who -d
pts/1 2023-12-23 16:47 14680 id=ts/1 term=0 exit=0
[root@academy ~]# who -q
root
# users=1
[root@academy ~]# who -b
system boot 2023-12-23 15:22
[root@academy ~]#
Last updated