fuser Command
Intermediate Performance & Debugging man(1)Identify processes using files or sockets
👁 8 views
📅 Updated: Mar 15, 2026
SYNTAX
fuser [OPTION]... NAME...
What Does fuser Do?
fuser identifies processes using files, directories, or sockets. It shows which processes have a resource open, and can optionally kill them. It is simpler than lsof for specific use cases.
fuser is most commonly used to find processes preventing a filesystem from being unmounted, or to identify which process is listening on a specific port.
fuser can send signals to the identified processes, making it a one-command solution for "find and kill" scenarios.
fuser is most commonly used to find processes preventing a filesystem from being unmounted, or to identify which process is listening on a specific port.
fuser can send signals to the identified processes, making it a one-command solution for "find and kill" scenarios.
Options & Flags
| Option | Description | Example |
|---|---|---|
| -v | Verbose output | fuser -v /var/log/syslog |
| -m | Show processes using mounted filesystem | fuser -vm /mnt/usb/ |
| -k | Kill processes using the resource | fuser -k /mnt/usb/ |
| -n tcp | Show process using TCP port | fuser -vn tcp 80 |
| -i | Interactive (ask before killing) | fuser -ki /mnt/usb/ |
Practical Examples
#1 Find processes on mount
Shows all processes accessing the mounted filesystem.
$ fuser -vm /mnt/usb/
Output:
USER PID ACCESS COMMAND
user 1234 ..c.. bash
user 5678 ...e. vim
#2 Kill processes on mount
Kills all processes using the mounted filesystem, allowing unmount.
$ sudo fuser -km /mnt/usb/#3 Check port usage
Shows which process is using TCP port 80.
$ fuser -vn tcp 80
Output:
80/tcp: 1234
#4 Kill port user
Kills the process listening on port 8080.
$ fuser -kn tcp 8080#5 Check file usage
Shows processes that have syslog open.
$ fuser -v /var/log/syslog#6 Interactive kill
Asks for confirmation before killing each process.
$ sudo fuser -ki /mnt/data/Tips & Best Practices
Unmount helper: Cannot unmount? fuser -km /mount/point kills blocking processes. Then umount succeeds.
fuser vs lsof: fuser is simpler for "who uses this file/port?" lsof is more detailed for comprehensive diagnostics.
-k kills without mercy: fuser -k sends SIGKILL by default. Use -ki for interactive mode to confirm each kill.
Frequently Asked Questions
How do I find what is preventing unmount?
fuser -vm /mount/point shows all processes using the filesystem. fuser -km kills them.
How do I check who is using a port?
fuser -vn tcp PORT shows the process. Or lsof -i :PORT for more detail.
What is the difference between fuser and lsof?
fuser identifies processes using a specific file/port. lsof lists all open files system-wide. fuser is simpler for targeted queries.
Related Commands
More Performance & Debugging Commands
Master Linux with Professional eBooks
Curated IT eBooks covering Linux, DevOps, Cloud, and more
Browse Books →