fuser

Display process IDs currently using files or sockets. More information: <https://manned.org/fuser>.

Install

All systems
curl cmd.cat/fuser.sh
Debian Debian
apt-get install psmisc
Ubuntu
apt-get install psmisc
Alpine
apk add psmisc
Arch Arch Linux
pacman -S psmisc
image/svg+xml Kali Linux
apt-get install psmisc
CentOS
yum install psmisc
Fedora
dnf install psmisc
Windows (WSL2)
sudo apt-get update sudo apt-get install psmisc
Raspbian
apt-get install psmisc
Docker
docker run cmd.cat/fuser fuser powered by Commando

Display process IDs currently using files or sockets. More information: <https://manned.org/fuser>.

  • Find which processes are accessing a file or directory:
    fuser path/to/file_or_directory
  • Show more fields (`USER`, `PID`, `ACCESS` and `COMMAND`):
    fuser --verbose path/to/file_or_directory
  • Identify processes using a TCP socket:
    fuser --namespace tcp port
  • Kill all processes accessing a file or directory (sends the `SIGKILL` signal):
    fuser --kill path/to/file_or_directory
  • Find which processes are accessing the filesystem containing a specific file or directory:
    fuser --mount path/to/file_or_directory
  • Kill all processes with a TCP connection on a specific port:
    fuser --kill port/tcp

© tl;dr; authors and contributors