
For your Linux system, there may be multiple users connected to a computer at the same time. The good news is that you can easily find out who is on board and connect to the system. Learn how to list All Logged-in Users in your Linux computer.
1. Using the “who” command
We use the who
command to get information on the different users connected with the information displayed in four columns.
- The first column shows the usernames.
- The second column indicates the TTY used.
- The third column is the time the user logged in.
- The fourth is the hostname or IP address of the connected users.
You can also display the number of users logged on to the system with the -q
parameter.

It is possible to have more information by displaying all details of the current logged-in user with the -a
option.

You can get more details on how to use the command by using the --help
command if you need additional information.

2. Using the “w” command
Contrary to the who
command, the w
command shows the users who are logged in and what they are doing.

The output shows some useful information such as:
- current time
- how long the system has been running
- number of users currently logged in
- name of the logged-in user
- remote host
- time the user logged in
You can also display just the information about the logged-in users when you use the -h
option.
You can filter the output of the command by using some other options. It’s possible to have a full list of the different options and their roles with the w --help
command.

3. Using the “users” command
There is also the simple command users
that shows only the users currently logged in without a parameter.

This command does not provide additional information like other commands, but you still know who is currently connected to the system. When you use the man users command, you will see that there is no other information.

4. Using the “last” command
We can use another command. The last command with -a parameter provides you with information such as username (even a special user like “reboot”), TTY, and IP address of the user’s connection.

When you use the -p
parameter, it is possible to display the users connected to the present day.
The command also offers more options that can help you to have useful information. You can check with the man last
command.

Using all the above commands, you can easily list the users logged in to Linux. This will allow you to monitor the system and see if there is any unauthorized access. If necessary, you can use these user management commands to perform certain actions on the identified users.
No Responses