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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. K3b Nero like CD/DVD Burning Software in Ubuntu Linux
  2. lsblk Command Examples in Linux
  3. How to Enable/Disable CPUs (Limiting CPU count) in CentOS / RHEL
  4. eject Command Examples in Linux
  5. pidof Command Examples in Linux
  6. CentOS / RHEL 6,7 : How to use yum history to roll back a yum update
  7. daemon: command not found
  8. CentOS / RHEL : How to add a null route in Linux
  9. How to debug systemd boot process in CentOS/RHEL 7 and 8
  10. How to configure Linux Resource Groups (cgroups) for MySQL

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright