fuser command
fuser shows processes using files or sockets
Typical usage: diagnosing network issues, disk operations, information gathering, troubleshootingIntroduction 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 system | Package name | Installation |
---|---|---|
AlmaLinux | psmisc |
|
Arch Linux | psmisc |
|
Debian | psmisc |
|
Fedora | psmisc |
|
Red Hat Enterprise Linux | psmisc |
|
Rocky Linux | psmisc |
|
openSUSE | psmisc |
|
Ubuntu | psmisc |
|
Your Linux distribution using a different package? Share your feedback.
Usage
Available options
Long option | Short option | Description |
---|---|---|
--interactive | -i | Before killing a process (see --kill), ask confirmation |
--kill | -k | Kill the process(es) that have the file or socket open |
--mount MOUNTPOINT | -m MOUNTPOINT | Show processes that have file open at specified mount point |
--ipv4 | -4 | Only search for IPv4 sockets |
--ipv6 | -6 | Only search for IPv6 sockets |
--verbose | -v | Verbose 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:
Command | Category | Summary |
---|---|---|
basename | files | Strips directory and file name suffix from a given path |
lsfd | files | Shows open file descriptors for processes |
lsof | files | Shows open files and sockets |
watch | processes | Monitors changes in output of specified command |