← All commands
Topic hub Security & Permissions
Windows Linux Security & Permissions 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

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

Migration tip: w 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.

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

This command is the same on Debian/Ubuntu, Fedora and Arch Linux when the relevant tool is installed.

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