fuser
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
andCOMMAND
):
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
License and Disclaimer
The content on this page is copyright © 2014—present the tldr-pages team and contributors.This page is used with permission under Creative Commons Attribution 4.0 International License.
While we do attempt to make sure content is accurate, there isn't a warranty of any kind.