← All commands
Topic hub Security & Permissions
Windows Linux Security & Permissions Expanded guide Users & Groups

Windows net session / query user equivalent in Linux

Lists currently logged-in users, what they are doing, and recent login history.

Windows net session / query user
→
Linux equivalents
Debian/Ubuntu same command
who / w / last
Fedora same command
who / w / last
Arch same command
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.

Migration tip: <code>w</code> is the most informative — it shows not just who is logged in but the current command they're running and how long they've been idle.

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.

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 optionUse
whoWho is currently logged in
wLogged-in users + what they're doing
lastLogin history (most recent first)
last -n 20Last 20 login events
sudo lastbFailed 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.

DistributionPackage manager / baseEquivalent commandDifference 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

Related Security & Permissions commands