Fuser (Unix)
From Wikipedia, the free encyclopedia
From Wikipedia, the free encyclopedia
The Unix command fuser
is used to show which processes are using a specified computer file, file system, or Unix socket.
This article needs additional citations for verification. (January 2021) |
For example, to check process IDs and users accessing a USB drive:
$ fuser -m -u /mnt/usb1
/mnt/usb1: 1347c(root) 1348c(guido) 1349c(guido)
The command displays the process identifiers (PIDs) of processes using the specified files or file systems. In the default display mode, each PID is followed by a letter denoting the type of access:
Only the PIDs are written to standard output. Additional information is written to standard error. This makes it easier to process the output with computer programs.
The command can also be used to check what processes are using a network port:
$ fuser -v -n tcp 80
USER PID ACCESS COMMAND
80/tcp: root 3067 F.... (root)httpd
apache 3096 F.... (apache)httpd
apache 3097 F.... (apache)httpd
The command 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.
POSIX defines the following options:[1]
psmisc adds the following options, among others:[2]
Seamless Wikipedia browsing. On steroids.
Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.
Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.