Sometimes, it is important to check the current users who are working on Linux system. Let us consider an example. Suppose you are a root user and you want to do some changes in the configuration files but at the same time you did not want any user to be logged in or perform any changes. So, for the same you need to check who are the users currently logged in.
Here, in this tutorial we are going to explain some of the commands that will help you to check currently logged in users in Linux system.

Before proceeding to know about the commands first login to your SSH client Putty with root credentials. Now, let us go through the procedure in detail.
The command that is used to check current logged in users is who command
. You can use various arguments with the command to get detailed information about the users.
- Login to SSH with root credentials.
- Execute
who command
and then hit Enter. List of all users will appear.

*You will get same output when you use who am i command.
Now, let us see some of the arguments with who command
to list current logged in users in Linux.
- who -a: This command list all the users with the process they are using currently.

- who -b: This command will display the last date and time the user has rebooted the system.
- who -H: This command displays the user information with headings.

- who -q: This command displays list of users with counts.

There are some other commands that are used to get the list of currently logged in users.
- w command: This command is used to display all the users who are currently logged in with the information of process they are doing.

It displays the various information related to user that includes:
- Name of the user (USER)
- User’s machine number or TTY number
- Remote machine address (FROM)
- User’s Login time (LOGIN@)
- Idle time, i.e, not usable time (IDLE)
- Time used by all processes attached to the TTY (JCPU time)
- Time used by the current process (PCPU time)
- Command currently getting executed by the users (WHAT)
You can use various arguments like w -s, w -u, w -h
etc with w command
to get more information.
You can also use commands like id, users
to get information related to currently logged in users in Linux system.
That’s it !
I’ve tried to share as much information that help you to get information about the currently logged in users in Linux. Do share it with your colleagues. Also share your suggestions so that we write more and drop your queries to have discussion on the related topics. Connect with us on social media pages with the links given below.
Facebook Page: https://facebook.com/redserverhost Twitter Page: https://twitter.com/redserverhost.com