2015-12-30 11:16:51 -06:00
|
|
|
# fuser
|
|
|
|
|
|
|
|
> Display process IDs currently using files or sockets.
|
2021-07-09 16:45:55 +02:00
|
|
|
> More information: <https://manned.org/fuser>.
|
2015-12-30 11:16:51 -06:00
|
|
|
|
2019-12-29 06:52:10 +00:00
|
|
|
- Find which processes are accessing a file or directory:
|
2015-12-30 11:16:51 -06:00
|
|
|
|
2019-12-29 06:52:10 +00:00
|
|
|
`fuser {{path/to/file_or_directory}}`
|
|
|
|
|
|
|
|
- Show more fields (`USER`, `PID`, `ACCESS` and `COMMAND`):
|
|
|
|
|
2025-06-28 12:47:40 +03:00
|
|
|
`fuser {{[-v|--verbose]}} {{path/to/file_or_directory}}`
|
2019-12-29 06:52:10 +00:00
|
|
|
|
|
|
|
- Identify processes using a TCP socket:
|
|
|
|
|
2025-06-28 12:47:40 +03:00
|
|
|
`fuser {{[-n|--namespace]}} tcp {{port}}`
|
2019-12-29 06:52:10 +00:00
|
|
|
|
|
|
|
- Kill all processes accessing a file or directory (sends the `SIGKILL` signal):
|
|
|
|
|
2025-06-28 12:47:40 +03:00
|
|
|
`fuser {{[-k|--kill]}} {{path/to/file_or_directory}}`
|
2019-12-29 06:52:10 +00:00
|
|
|
|
|
|
|
- Find which processes are accessing the filesystem containing a specific file or directory:
|
|
|
|
|
2025-06-28 12:47:40 +03:00
|
|
|
`fuser {{[-m|--mount]}} {{path/to/file_or_directory}}`
|
2022-07-15 21:03:17 +05:30
|
|
|
|
|
|
|
- Kill all processes with a TCP connection on a specific port:
|
|
|
|
|
2025-06-28 12:47:40 +03:00
|
|
|
`fuser {{[-k|--kill]}} {{port}}/tcp`
|