w and who (Check Current User Login Status)
The who
command is used to show login records of users currently logged in. The w
command is also used to show who is currently logged in but, in addition to that, it also gives information of what they are doing. These commands don't capture information about the users who are not logged in to the system.
This is an example result of the who
command.
who
ubuntu pts/0 2023-01-03 01:34 (54.240.197.53)
This is an example result of the w
command.
w
01:57:45 up 17:30, 1 users, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
ubuntu pts/1 54.239.99.12 01:52 1.00s 0.03s 0.00s w