who command in Linux with Examples

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:

who command in Linux with Examples

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 the w 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 Linux? It is the most popular in-use terminal Linux show who is logged on.

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!

About HuuPV

My name is Huu. I love technology, especially Devops Skill such as Docker, vagrant, git, and so forth. I like open-sources, so I created DevopsRoles.com to share the knowledge I have acquired. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.