Linux Command: fuser
Identify processes using files or sockets
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.
Syntax
fuser [OPTION]... NAME...Key Options
-vโ Verbose output-mโ Show processes using mounted filesystem-kโ Kill processes using the resource-n tcpโ Show process using TCP port-iโ Interactive (ask before killing)
Examples
Find processes on mount
fuser -vm /mnt/usb/Output: USER PID ACCESS COMMAND
user 1234 ..c.. bash
user 5678 ...e. vim
Kill processes on mount
sudo fuser -km /mnt/usb/Check port usage
fuser -vn tcp 80Output: 80/tcp: 1234
Pro Tips
- Cannot unmount? fuser -km /mount/point kills blocking processes. Then umount succeeds.
- fuser is simpler for "who uses this file/port?" lsof is more detailed for comprehensive diagnostics.
- fuser -k sends SIGKILL by default. Use -ki for interactive mode to confirm each kill.
Learn more: Full fuser reference โ
Related Resources