Files and folders in Linux are accessed by processes of a particular identity. You must know the id of the specific process if you want to perform any action on that process.
It is among the most important tasks of Linux systems administrators. It is involved in a number of activities under supervision, signaling processes, and setting the priorities of processes on the system.
Here at Ibmi Media, we shall look into how to find processes by using the fuser command in Linux.
It's syntax is given below:
$ fuser [options] [file|socket]
$ fuser [options] -SIGNAL [file|socket]
$ fuser -l
Or you can look up usage with the command:
$ fuser
1. Check the process detail accessing
$ fuser -v .
This will display USER, PID, ACCESS and COMMAND.
For example, To check the processes accessing of file test, run the below command:
$ fuser -v -m test
2. Kill signal
For example, to kill all the processes, run the command:
$ fuser -k .
To use -ki option to ask yes/no:
$ fuser -ki .
3. List all signals:
$ fuser -l
This article covers how to find processes by using the fuser command in Linux. In fact, the fuser command is primarily used to identify processes using files, directories, or sockets.
fuser command Options includes: