← All commands
Topic hub Services & Processes
Windows Linux Services & Processes Expanded guide Processes

Windows openfiles equivalent in Linux

Shows which files, sockets, and devices are currently open and by which processes.

Windows openfiles
→
Linux equivalents
Debian/Ubuntu same command
lsof
Fedora same command
lsof
Arch same command
lsof

Overview

What this command does

On Windows, "openfiles" is used to list open files and which process uses them. On Linux, the closest practical mapping shown here is "lsof". Shows which files, sockets, and devices are currently open and by which processes. This reference is grouped under Services & Processes → Processes.

Migration tip: <code>lsof</code> (List Open Files) is extremely powerful. In Linux, <strong>everything is a file</strong> — network sockets, devices, and pipes all appear in lsof output.

Windows → Linux context

What changes when you use this on Linux?

Equivalent task, different tool

Windows openfiles maps to lsof 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

List open files and which process uses them

Shows which files, sockets, and devices are currently open and by which processes.

lsof -u john

Files opened by user john

lsof -p 1234

Files opened by process 1234

lsof /var/log/syslog

Who has this file open?

Ready to run

Copyable Linux commands

Review paths, device names, package names and permissions before running any command.

lsof -i :80
lsof -p $(pidof nginx)
lsof /var/log/app.log

Walkthrough

Examples with explanations

# Windows: openfiles /query

# What process is using port 80?
lsof -i :80

# What files does nginx have open?
lsof -p $(pidof nginx)

# Who has this log file open?
lsof /var/log/app.log

Reference

Common options and variations

Command or optionUse
lsof -u johnFiles opened by user john
lsof -p 1234Files opened by process 1234
lsof /var/log/syslogWho has this file open?
lsof -i :80What process is using port 80?
lsof -i tcpAll open TCP connections

Distro differences

Debian/Ubuntu vs Fedora vs Arch

Debian/Ubuntu, Fedora and Arch all use "lsof" 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 lsof Same command on this distribution.
Fedora same command lsof Same command on this distribution.
Arch same command lsof Same command on this distribution.

Keep learning

Related Services & Processes commands