who command 5 ways

Problem

You want to know who is on the system. Or which userid you are using.
What runlevel you are at – or when the system was booted.

All doable with who.



Solution

See the example and reference tabs, to see 5 ways to run who, showing different things about the system and users.



Example


1. Basic


[marcus@bagend puterpet]$ who
marcus pts/1 Sep 19 16:07 (10.0.0.8)
marcus pts/3 Sep 22 17:46 (10.0.0.8)

2. With Heading and Idle time dot means currently active.


[marcus@bagend puterpet]$ who -Hu
NAME LINE TIME IDLE PID COMMENT
marcus pts/1 Sep 19 16:07 ? 29984 (10.0.0.8)
marcus pts/3 Sep 22 17:46 . 29566 (10.0.0.8)

3. Show who I am in the current shell and where I came from.


[marcus@bagend puterpet]$ who am i
marcus pts/3 Sep 22 17:46 (10.0.0.8)

4. Show the current run level Shows boot time and last runlevel too.


[marcus@bagend puterpet]$ who -r
run-level 5 Sep 9 10:47 last=S

5. Show last boot time


[marcus@bagend puterpet]$ who -b
system boot Sep 9 10:47



Reference

[tags]who command, Unix Coding School[/tags]



1 thought on “who command 5 ways”

Leave a Reply

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