From 6fe6ed96410d945fece24c79fbc392ceccad68de Mon Sep 17 00:00:00 2001 From: Miguel Mendes Date: Sun, 29 Dec 2019 06:52:10 +0000 Subject: [PATCH] fuser: add new examples (#2513) --- pages/linux/fuser.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/pages/linux/fuser.md b/pages/linux/fuser.md index 015c25b822..442892048d 100644 --- a/pages/linux/fuser.md +++ b/pages/linux/fuser.md @@ -1,8 +1,23 @@ # fuser > Display process IDs currently using files or sockets. -> Require admin privileges. -- Identify process using a TCP socket: +- Find which processes are accessing a file or directory: -`fuser -n tcp {{port}}` +`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}}`