• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

who Command Examples in Linux

by admin

The who command is used to determine the details of users currently logged in to a system. The output of the who command includes the user name, the name of the system from which the user is connected, and the date and time that the user has been connected since.

Syntax

The syntax of the who command is:

$ who [options]

For examples, who command without any options:

$ who
geek    console  Sep  4 21:11
geek    ttys000  Sep  5 19:36

who Command options

The -u option can be used to see how long users have been idle. A dot indicates that the users were active up to the last minute, old indicates that the users have been inactive for over 24 hours, and anything between 2 minutes and 23 hours 59 minutes shows the length of time they have been idle. The “am i” option displays information only for the user who runs the command.

$ who -u
geek    console  Sep  4 21:11  old  	   131
geek    ttys000  Sep  5 19:36   .   	  3874
$ who am i
geek    ttys000  Sep  5 19:36

who Command Examples

1. To see who is logged in:

# who

2. To see all the users logged in:

# who -a

3. To see last time of system boot:

# who -b

4. To see the dead processes:

# who -d 

5. To see the column headings:

# who -H 

6. To print system login processes:

# who -l 

7. To print active processes spawned by init:

# who -p 

8. To count the all logins:

# who -q 

9. To print the current runlevel:

# who -r 

10. To print system last clock change:

# who -t 

Filed Under: Linux

Some more articles you might also be interested in …

  1. envsubst: command not found
  2. dd: command not found
  3. dcfldd: Enhanced version of dd for forensics and security
  4. circup: The CircuitPython library updater
  5. How to Map Static IP to your Domain (with GoDaddy example)
  6. tshark: command not found
  7. gnmic Command Examples
  8. whatis: command not found
  9. dpkg-reconfigure Command Options
  10. CentOS / RHEL : How to Disable / Enable direct root and non-root user ssh login

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright