How do you enable FTP to be available to your server and users?
Brute force attacks, spoofing, and sniffing are all possible with FTP data. The protocol has…
Linux is a multi‑user operating system, which means several people can be logged in at the same time locally, remotely, or through different terminals. As a system administrator, knowing how many users are online helps you troubleshoot performance issues, monitor activity, and manage sessions more effectively. Linux provides several built‑in commands that make this easy.
When we talk about “users online,” we are referring to accounts that have an active session on the system. This can include users connected through SSH, working on a local terminal, or logged in through remote tools. Linux records all login activity, and the system commands below help you view this information quickly.
Below are the most useful commands for checking user activity. Each command serves a slightly different purpose.
who – Show Active Login SessionsThe who command lists all users currently logged in and their session details.
Example: who
What it shows:
w – Show Logged‑In Users with Activityw provides a more detailed view, showing both user logins and what each user is doing.
Example: w
What it shows:
users – Quick List of Logged‑In Usersusers gives a simple, space‑separated list of usernames.
Example: users
Useful when: You only need the usernames without additional details.
last – View Recent Login HistoryWhile not limited to current sessions, last helps you review previous logins and reboots.
Example: last
Useful for: Auditing user access over time.
whoami – Display the Current UserThis command shows the username of the session you’re in right now.
Example: whoami
To see the number of logged‑in users, you can combine commands with simple shell utilities.
users + wc:users | wc -w
who + wc:who | wc -l
who | awk ‘{print $1}’ | sort -u | wc -l
Linux also stores session data in special system files:
/var/run/utmp – current logins/var/log/wtmp – login history/var/log/btmp – failed login attemptsSome commands read from these files automatically, so you rarely need to access them directly.
To specifically see SSH users:
who | grep pts
Or check SSH sessions with:
ss -t -a | grep ssh
Linux provides built‑in help for all commands:
Or use:
This gives you additional examples and command‑specific options.
Linux offers several quick and reliable ways to check who is currently online. Commands like who, w, and users help you see active sessions, while tools like last show login history. Whether you’re monitoring an SSH server or managing multiple users on a shared machine, these built‑in commands give you everything you need to track user activity effectively.
Discover How to Rename Files in Linux – Master File Management with Our Easy-to-Follow Tutorial!
Explore more hosting insights, tips and industry updates.
Brute force attacks, spoofing, and sniffing are all possible with FTP data. The protocol has…
If you ever find yourself needing to configure Windows Firewall settings in order to open…
In this article, we will explain how to effectively control email deliverability settings in cPanel,…