Windows net session / query user equivalent in Linux
Lists currently logged-in users, what they are doing, and recent login history.
net session / query user
who / w / last
who / w / last
who / w / last
Overview
What this command does
On Windows, "net session / query user" is used to see who is currently logged in. On Linux, the closest practical mapping shown here is "who / w / last". Lists currently logged-in users, what they are doing, and recent login history. This reference is grouped under Security & Permissions → Users & Groups.
Windows → Linux context
What changes when you use this on Linux?
Equivalent task, different tool
Windows net session / query user maps to who / w / last for this task. Treat this as a workflow mapping rather than a character-for-character syntax translation.
Portable across the compared distros
The Debian/Ubuntu, Fedora and Arch rows use the same command in this mapping. Package availability or defaults can still vary, so check the installed tool version when an option behaves differently.
For the broader concept behind this mapping, read Linux permissions for Windows users.
Practical tasks
Common use cases
See who is currently logged in
Lists currently logged-in users, what they are doing, and recent login history.
who
Who is currently logged in
w
Logged-in users + what they're doing
last
Login history (most recent first)
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
who
w
last
sudo lastb
Walkthrough
Examples with explanations
# Windows: query user or net session
who # john pts/0 Jan 15 09:00
w # who + idle time + current command
last # login/logout history
sudo lastb # failed login attempts
Reference
Common options and variations
| Command or option | Use |
|---|---|
who | Who is currently logged in |
w | Logged-in users + what they're doing |
last | Login history (most recent first) |
last -n 20 | Last 20 login events |
sudo lastb | Failed login attempts |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
Debian/Ubuntu, Fedora and Arch all use "who / w / last" for this mapping. The command syntax shown here is portable across the three rows, although installed versions and system defaults can still vary.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | same command | who / w / last |
Same command on this distribution. |
| Fedora | same command | who / w / last |
Same command on this distribution. |
| Arch | same command | who / w / last |
Same command on this distribution. |
Keep learning