fuser is a tool used to identify processes based on the files they're using (eg. regular file, socket, network connection, ...).
fuser can identify and signal processes which are using a specific (set of) resource(s), such as:
- A file
- A socket
- A network connection (TCP/UDP sockets).
- A file system
- A device
The man page (fuser(1)) provides some examples:
# Kill all processes accessing the filesystem mounted at /home.
fuser -km /home
# Execute something is a process is using /dev/ttyS1.
fuser -s /dev/ttyS1 && ...
# Show all processes using the telnet port for TCP exchanges.
fuser telnet/tcp
See the man page for a complete list of options, features, and restrictions.