The Full Wiki

More info on Fuser (Unix)

Fuser (Unix): Wikis

Advertisements

Note: Many of our articles have direct quotes from sources you can cite, within the Wikipedia article! This article doesn't yet, but we're working on it! See more info or our list of citable articles.

Encyclopedia

(Redirected to fuser (Unix) article)

From Wikipedia, the free encyclopedia

fuser is a UNIX command used to show which processes are using a specified file, file system, or socket. For example:

# fuser -m -u /mnt/usb1
/mnt/usb1:   1347c(root)  1348c(guido)  1349c(guido)

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:

current directory.
executable being run.
open file.
open file for writing.
root directory.
mmap'ed file or shared library

fuser returns a non-zero code if none of the files are accessed or in case of a fatal error. If at least one access has succeeded, fuser returns zero. The output of "fuser" may be useful in diagnosing "resource busy" messages arising when attempting to unmount filesystems.

Options

-k 
kills all process accessing a file. For example fuser -k /home/export/ganesh kills all processes accessing this directory without confirmation. Use -i for confirmation
-i 
interactive mode. Prompt before killing process
-v 
verbose.
-u 
append username
-a 
display all files

Also note that -k sends a SIGKILL to all process. Use the -signal to send a different signal. For a list of signals supported by the fuser run 'fuser -l'

Related commands

  • The list of all open files and the processes that have them open can be obtained through the lsof command.
  • The equivalent command on BSD operating systems is fstat(1)

External links

fuser(1): identify processes using files or sockets – Linux User Commands Manual

Advertisements

Advertisements






Got something to say? Make a comment.
Your name
Your email address
Message