Identify processes using files or sockets.
low risk
fuser identifies which processes are using specified files, directories, or network sockets. Simpler than lsof for the specific question 'what is using this file/port?' Returns PIDs which can be targeted directly.
| Flag | Meaning |
|---|---|
-v --verbose | Verbose output including username and access type |
-n --namespace | Select namespace: file, tcp, udp |
-k --kill | Kill processes (sends SIGKILL by default) |
-m --mount | All processes accessing the mount point |
fuser 8080/tcpFind PID using TCP port 8080 · explain & risk-check →fuser -v /var/log/app.logVerbose: show who has log file open · explain & risk-check →fuser -k 8080/tcpKill process using port 8080 · explain & risk-check →fuser -m /mnt/dataFind all processes accessing a mounted volume · explain & risk-check →Before `umount` fails with 'device is busy', run `fuser -mv /mountpoint` to find exactly which process is holding the mount — saves the 'why can't I unmount this' frustration.
Reference text is hand-written and may be incomplete — check man fuser for your version. Test destructive commands on a non-production system first.