fuser command

fuser shows processes using files or sockets

Typical usage: diagnosing network issues, disk operations, information gathering, troubleshooting

Introduction into fuser

The fuser command is a tool for Linux systems to quickly identify which processes have a file or socket opened. This can be useful during unmounting a file system or finding our what processes have a connection active.

Installation

When fuser is not installed by default, it can be added to the system using the relevant software package.

Package information for fuser

Operating systemPackage nameInstallation
AlmaLinuxpsmisc
dnf install psmisc
Arch Linuxpsmisc
pacman -S psmisc
Debianpsmisc
apt install psmisc
Fedorapsmisc
dnf install psmisc
Red Hat Enterprise Linuxpsmisc
dnf install psmisc
Rocky Linuxpsmisc
dnf install psmisc
openSUSEpsmisc
zypper install psmisc
Ubuntupsmisc
apt install psmisc

Your Linux distribution using a different package? Share your feedback.

Usage

Available options

Long optionShort optionDescription
--interactive-iBefore killing a process (see --kill), ask confirmation
--kill-kKill the process(es) that have the file or socket open
--mount MOUNTPOINT-m MOUNTPOINTShow processes that have file open at specified mount point
--ipv4-4Only search for IPv4 sockets
--ipv6-6Only search for IPv6 sockets
--verbose-vVerbose output to show more details

Missing an option in this overview? Share your feedback.

Examples using fuser

Show which processes have TCP port 22 socket open including details

fuser --verbose --ipv4 22/tcp

Select namespace 'tcp' and select port 22 to see which processes have the socket open with verbose for details

fuser --verbose --namespace tcp 22

Show all processes that have a file open at the specified mount point

fuser --verbose --mount /mnt/mydata

Frequently Asked Questions

What is the fuser command and its purpose?

The fuser command is a command-line tool to show which processes have a file or socket opened

Which package provides the fuser command?

The command fuser is provided by the psmisc package.

Related and similar commands

Linux has a lot of tools and commands available and sometimes you just need that little other tool. Here is a list of commands that are similar or related to fuser:

Related and similar commands to fuser
CommandCategorySummary
basenamefilesStrips directory and file name suffix from a given path
lsfdfilesShows open file descriptors for processes
lsoffilesShows open files and sockets
watchprocessesMonitors changes in output of specified command