fuser¶
"fuser - identify processes using files or sockets" - man fuser
This command is not directly related to the FUSE command fusermount.
The output here is a bit unusual in that it sends PIDs to stdout and everything else to stderr, but interleaves them so what you see in the terminal is much different from what you get via pipes.
Examples¶
Show what is using /var/log¶
See man fuser for the meaning of each letter.
But what you get via a pipe is just the pids. The first line of output is all of stderr, and beyond that is stdout.
Kill all processes accessing a given file¶
Show processes accessing the local ssh port¶
This only works for local ports.
## By service/protocol (see /etc/services)
sudo fuser ssh/tcp
## By arbitrary port/protocol
sudo fuser 22/tcp