- Trending Categories
- Data Structure
- Operating System
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to list all users who are currently logged into the Linux system?n
To check information about users who are currently logged into the system, we use the who command in the Linux system.
The who command is used to display the users logged into the system. The who command related to the w command that is used to display information about the users currently on the machine and their processes.
The general syntax of the who command is as follows −
who [OPTION]... [ FILE | ARGUMENT1 ARGUMENT2 ]
Brief description of options available in the who command.
|Sr.No.||Option & Description|
Same as -b -d --login -p -r -t -T -u
Display last rebooted time of system
Display dead processes and details
Display line of column headings
Display system login processes
Attempt to canonicalize hostnames via DNS
Display all login names and number of users logged on
Display only name of user, line, and time (default)
Display last system clock change
|10||-T, -w, --mesg|
Add user’s message status as +, - or ?
Display list users logged in
Same as -T
Same as -T
Displays a help message and then exits.
It gives info about the version and then exits.
To displays the name of users currently logged in, terminal line numbers, login time of the users in the system, and remote hostname of the user in the Linux system, we use the who command without any options and arguments as shown below.
vikash@tutorialspoint:~$ who vikash :0 2021-01-11 09:40 (:0)
To enhance the output and print information in standard input, we use -H option with the who command as shown in below.
vikash@tutorialspoint:~$ who -H NAME LINE TIME COMMENT vikash :0 2021-01-11 09:40 (:0)
To display the last booted time of the Linux/Unix system using the terminal, we use -b or -- boot option with the who command as shown below.
vikash@tutorialspoint:~$ who –boot System boot 2021-01-11 09:37
vikash@tutorialspoint:~$ who -b System boot 2021-01-11 09:37
To display the current login user in the Linux system, we use the whoami command without any option and arguments as shown below.
vikash@tutorialspoint:~$ whoami vikash
To display more information about the command, we use --help option with the who command as shown in below.
$ who --help
- How to list all users who are currently logged into the Linux system?\n
- List logged-in MySQL users?
- How to list all users in a Linux group?
- MySQL Select to get users who have logged in today?
- Find the count of users who logged in between specific dates with MongoDB
- How to list all users in the Mongo shell?
- How to Create a Shared Directory for All Users in Linux?
- How to get the currently logged-in user account with Azure CLI in PowerShell?
- Who are currently the best programmers in the world?
- How to get a list of all the fonts currently available for Matplotlib?
- Who are currently the top 5 richest cricketers in the world?
- How to List All Connected SSH Sessions on Linux
- How to Find out Linux Version currently Installed on your Machine?
- How to display the last part of the file in the Linux system?\n
- How to list down all the available commands and aliases on Linux?
- How to remove sections from each line of files in the Linux system?\n