FUSER(1)

NAME
fuser - identify processes using files

SYNOPSIS
fuser [-a|-s] [-signal] [-kmuv] filename ... [-] [-signal] [-kmuv] filename ...
fuser [-l]

DESCRIPTION
fuser displays the PIDs of processes using the specified files or file systems. In the default display mode, each file name is followed by a letter denoting the type of access:

    c   current directory.

    e   executable being run.

    f   open file. f is omitted in default display mode.

    r   root directory.

    m   mmap'ed file or shared library.

fuser returns a non-zero return code if none of the specified files is accessed or in case of a fatal error. If at least one access has been found, fuser returns zero.

OPTIONS

-a  show all files specified on the command line. By default, only files that are accessed by at least one process are shown.

-k  kill processes accessing the file. Unless changed with -signal, SIGKILL is sent.

-l  list all known signal names.

-m  filename specifies a file on a mounted file system or a block device that is mounted. All processes accessing files on that file system are listed. If a directory file is specified, it is automatically changed to filename/. to use any file system that might be mounted on that directory.

-s  silent operation. -a, -u and -v are ignored in this mode.

-signal
    use the specified signal instead of SIGKILL when killing processes. Signals can be specified either by name (e.g. -HUP) or by number (e.g. -1).

-u  append the user name of the process owner to each PID.

-v  verbose mode. Processes are shown in a ps-like style. The fields PID, USER and COMMAND are similar to ps. ACCESS shows how the process accesses the file.

-   reset all options and set the signal back to SIGKILL.

FILES
/proc	location of the proc file system

EXAMPLES
fuser -km /home kills all processes accessing the file system /home in any way.

if fuser -s /dev/ttyS1; then :; else something; fi invokes something if no other process is using /dev/ttyS1.

RESTRICTIONS
Processes accessing the same file or file system several times in the same way are only shown once.

SEE ALSO
kill(1), killall(1), ps(1)

AUTHOR
Werner Almesberger <almesber@bernina.ethz.ch>