Table of Contents
Introduction
who command Displays a list of users who are currently logged into the computer? The who
command in Linux is used to display information about users who are currently logged in to the system. It provides details such as username, terminal, login time, and remote host. Here are some examples of using the who
command:
Linux offers a robust set of tools for managing and monitoring user sessions and system activity. Among these, the who
command stands out as a simple yet powerful utility. Whether you’re a system administrator checking logged-in users or a developer troubleshooting access issues, understanding the who
command is essential. This guide dives deep into the who
command, explaining its functionality, use cases, and examples to empower Linux users of all levels.
What Is the who Command in Linux?
The who
command provides details about users currently logged into the system. By running this command, you can obtain valuable insights such as:
- Usernames of logged-in users
- Terminal session details
- Login times
- Hostnames or IP addresses
Its simplicity and efficiency make it a staple tool for Linux professionals.
How to Use the who Command in Linux
Basic Syntax
The syntax for the who
command is straightforward:
On the man page, the describes it
- who – show who is logged on.
man who – More details information.
who command in Linux with Examples?
$ who
Show only the username and login time:
who -u
Include the idle time of logged-in users:
who -u -i
Show the IP addresses of remote hosts:
who -a
Show the process ID associated with each login session:
who -p
Frequently Asked Questions (FAQ)
What is the difference between who and w?
- The
who
command shows currently logged-in users, while thew
command provides additional details about what each user is doing.
Can I use the who
command on macOS?
Yes, the who
command works on macOS as it is a Unix-based system, though some options may vary.
How does who
differ from users
?
The users
command lists usernames of logged-in users in a single line without additional details.
Conclusion
who command is the simple command in
These are some common examples of using the who
command. There are additional options available, which can be explored by referring to the command’s manual page using man who
or by checking the command’s help using who --help
. Thank you for reading the DevopsRoles page!