Updated: October 28, 2024 |
List the process IDs of all processes that have one or more files open (POSIX)
fuser [-cfsu] file...
QNX Neutrino
The fuser utility writes to standard output the process IDs of processes running on the local system that have one or more named files open. For block special devices, all processes using any file on that device are listed.
This utility writes to standard error additional information about the named files indicating how the file is being used:
This character: | Indicates that: |
---|---|
o | (QNX Neutrino extension) The process has the file open |
When standard output and standard error are directed to the same file, the output is interleaved so that the filename appears at the start of each line, followed by the process ID and characters indicating the use of the file. Then, if you specified the -u option, the user name or user ID for each process using that file is written.
A newline character is written to standard error after the last output described above for each file operand.
Suppose that /q6 is mounted on /dev/hd0t178 and has a process with an open file /q6/Z:
This command: | Gives this output: | Because: |
---|---|---|
fuser /q6 | /q6: | Nothing has /q6 (a directory) directly open |
fuser -c /q6 | /q6: 811026o | The file is inside the /q6 filesystem |
fuser /dev/hd0t178 | /dev/hd0t178: 811026o | The file is inside the filesystem mounted on the (block) hd0t178 |
fuser -f /dev/hd0t178 | /dev/hd0t178: | The -f option indicates that you want to treat hd0t178 as the target file directly |
fuser /q6/Z | /q6/Z: 811026o | You specified a file; in this case, it doesn't matter if you specify -c or -f |