The who command is used to display information about users who are currently logged into the system. Here are some common usages of the who command:
-
Basic Usage:
Simply typewhoin the terminal to see a list of logged-in users:who -
Detailed Information:
To get more detailed information, you can use the-aoption:who -a -
Show User Login Time:
To display the login time of each user, you can use:who -u -
Show Users Logged in from a Specific Terminal:
You can specify a terminal to see users logged in from that terminal:who pts/0 -
Combine with Other Commands:
You can also combinewhowith other commands using pipes. For example, to count the number of logged-in users:who | wc -l
These commands will help you effectively use the who command to monitor user logins on your Linux system.
