Who Command in Linux


Who command in Linux is primarily used to display the information about the currently logged-in users of the system. However, you can tailor this information according to your requirements by making use of the different options available with this command. In this article, we will discuss the different usage scenarios of the Who command on a Linux Mint 21 system.

Using the Who Command in Linux Mint 21:

To use the Who command in Linux Mint 21 in different scenarios, you will have to go through the following examples:

Who-Command-Linux

How to find out all the Options Available with the Who Command?

The Who command in Linux can operate on different options. For finding out all the options that can be used with this command, you can execute the command shown below:

who-command-linux

$ who --help

All the options that can be used with the Who command can be seen in the following image. You can scroll up or down to see the entire list.

How do display the Information about the Currently Logged in User?

If you intend to display the information about the currently logged-in user of your Linux Mint 21 system, then you have to run the command shown below:

who-command-linux

$ who

The information such as login name, remote hostname, login time, and terminal line number of the currently logged-in user is shown in the following image:

who-command-linux

How to display the List of all the Logged in Users?

Multiple users can log into a system at a time. To display a list of all the users who are currently logged in to your Linux Mint 21 system, you should execute the command shown below:

$ who –u

The list of the currently logged-in users of our Linux Mint 21 system is shown in the image that follows:

who-command-linux

How to display the Last Boot System Time?

If you want to see the system time when it was last booted, then you need to run the Who command in the manner shown below:

$ who –b –H

The last boot system time is shown in the following image:

who-command-linux

How to show all the Dead Processes?

You can also display a list of all the dead processes by running the Who command as shown below:

$ who –d –H

In our case, since we did not have any dead processes on our system, therefore, the following output appeared on the terminal:

who-command-linux

How to display the Current Run Level of the System?

The run level of a system determines the state of your machine once it has been booted. To display the run level of your Linux Mint 21 system, you have to execute the command given below:

$ who –r

The current run level of our Linux Mint 21 system is shown in the following image:

who-command-linux

How to display all the Details of the Currently Logged in User?

Now, if you want to display all the relevant details of your currently logged-in user, then you have to run the command shown below:

$ who –a

All the details of the currently logged-in user of our Linux Mint 21 are shown in the following image:

who-command-linux

Conclusion

This guide discussed some of the most common usage scenarios of the Who command on a Linux Mint 21 system. By following the same lines, you can also explore the other options that can be used with this command.

If you are interested in cal command examples, read here.

Print Friendly, PDF & Email
Categories