NAME
fuser — list
process IDs of all processes that have one or more files open
SYNOPSIS
fuser |
[-cfu] file
... |
DESCRIPTION
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.
The fuser utility writes to standard error
additional information about the named files indicating how the file is
being used.
Any output for processes running on remote systems that have a named file open is unspecified.
A user may need appropriate privilege to invoke the
fuser utility.
OPTIONS
The fuser utility supports the XBD
specification,
Utility
Syntax Guidelines .
The following options are supported:
OPERANDS
- file
- A pathname on which the file or file system is to be reported.
STDIN
Not used.
INPUT FILES
The user database.
ENVIRONMENT VARIABLES
The following environment variables affect the execution of
fuser :
LANG- Provide a default value for the internationalization variables that are
unset or null. If
LANGis unset or null, the corresponding value from the implementation-dependent default locale will be used. If any of the internationalization variables contain an invalid setting, the utility will behave as if none of the variables had been set. LC_ALL- If set to a non-empty string value, override the values of all the other internationalization variables.
LC_CTYPE- Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters in arguments).
LC_MESSAGES- Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.
NLSPATH- Determine the location of message catalogues for the processing of LC_MESSAGES .
ASYNCHRONOUS EVENTS
Default.
STDOUT
The fuser utility will write the process
ID for each process using each file given as an operand to standard output
in the following format:
"%d", <process_id>
STDERR
The fuser utility writes diagnostic
messages to standard error.
The fuser utility also writes the
following to standard error:
- The pathname of each named file is written followed immediately by a colon.
- For each process ID written to standard output, the character c is written to standard error if the process is using the file as its current directory and the character r is written to standard error if the process is using the file as its root directory. Implementations may write other alphabetic characters to indicate other uses of files.
- When the
-uoption is specified, characters indicating the use of the file are followed immediately by the user name, in parentheses, corresponding to the process' real user ID. If the user name cannot be resolved from the process' real user ID, the process' real user ID is written instead of the user name.
When standard output and standard error are directed to the same
file, the output is interspersed 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 the -u option is specified,
the user name or user ID for each process using that file is written.
A new line character is written to standard error after the last output described above for each file operand.
OUTPUT FILES
None.
EXTENDED DESCRIPTION
None.
EXIT STATUS
The following exit values are returned:
CONSEQUENCES OF ERRORS
Default.
APPLICATION USAGE
None.
EXAMPLES
The command:
fuser -fu .
writes to standard output the process IDs of processes that are using the current directory and writes to standard error an indication of how those processes are using the directory and the user names associated with the processes that are using the current directory.
FUTURE DIRECTIONS
None.
SEE ALSO
None.