Linux Terminal Command: who
The who command is an essential tool in User & Permission Management. In this tutorial, we will explore what who does, look at everyday examples, and cover advanced options to supercharge your command-line workflow.
Concept & Explanation
The who command prints a simplified list of users currently logged into the system, detailing their terminal lines and session login times.
Common Options & Syntax
who [options] [arguments]
Here are the most common flags used with who:
- Simple Usage: Basic default commands.
- Detailed View: Shows diagnostic information.
- Advanced Actions: Can chain parameters for scripting.
1. Interactive Example (Simple)
Here is how most people run the command:
# Example
who
What it does: Lists active users, terminals, and login timestamps.
2. Power-User Example (Advanced)
For scripting and advanced diagnostics, use this configuration:
# Advanced
who -b -q
What it does: Shows the time of the last system boot (-b) and lists the total number of logged-in users (-q).
⚙️ Warning & Common Pitfalls
[!WARNING] Unlike
w,whodoes not show current process CPU usage or idle time.
🔗 Related Commands
Here are some related posts on cli_tty1 you might want to check out:
- w : Show who is logged on and what they are doing.