The fuser command allows you to display processes using a file or file system.
Syntax
fuser [-c|-f] [-u] [-k] path ... |
All processes which use arbitrary files from the file system at the mountpoint path are displayed.
Only those processes are displayed which use the path file themselves (for device files only).
Displays the user ID of the processes found after the process ID.
The processes found are terminated with the SIGKILL signal.
File name or file system mount point. Options -c und -f not specified: For special device files representing a mounted file system the option -c is set implicitly, for all other files the option -f is set. For each process found fuser displays:
process ID (to stdout) Usage flag
|
Example 1
Display users of a file:
|
Example 2
Display users of two file systems with user names:
|
Example 3
Display information on all processes using a file system:
The process IDs concerned are read into the PIDLST variable, display of the usage flags (stderr) being suppressed. The process IDs are then processed further in the for loop. |