Jan 21st, 2010
fuser - identify processes using files or sockets
fuser - identify processes using files or sockets
In order to look up processes using TCP and UDP sockets, the corresponding name space has to be selected with the -n option. By default fuser will look in both IPv6 and IPv4 sock-ets. To change the default, behavior, use the -4 and -6 options. The socket(s) can be specified by the local and remote port, and the remote address. All fields are optional, but commas in front of missing fields must be present:
Either symbolic or numeric values can be used for IP addresses and port numbers.
fuser outputs only the PIDs to stdout, everything else is sent to stderr.
USER PID ACCESS COMMAND
25/tcp: root 3926 F…. master
FILES
/proc location of the proc file system
EXAMPLES
fuser -km /home kills all processes accessing the file system /home in any way.
if fuser -s /dev/ttyS1; then :; else something; fi invokes something if no other process
is using /dev/ttyS1.
fuser telnet/tcp shows all processes at the (local) TELNET port.