This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Fuser" Unix – news ·newspapers ·books ·scholar ·JSTOR(January 2021) (Learn how and when to remove this message) |
| fuser | |
|---|---|
Example usage of fuser | |
| Operating system | Unix andUnix-like |
| Platform | Cross-platform |
| Type | Command |
TheUnixcommandfuser is used to show whichprocesses are using a specifiedcomputer file,file system, orUnix socket.
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 theprocess identifiers (PIDs) of processes using the specified files or filesystems. In the default display mode, each PID is followed by aletter denoting the type of access:
Only the PIDs are written tostandard 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-ntcp80 USER PID ACCESS COMMAND80/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 areaccessed 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 tounmount filesystems.
POSIX defines the following options:[1]
psmisc adds the following options, among others:[2]
fuser – Shell and Utilities Reference,The Single UNIX Specification, Version 5 fromThe Open Group. Retrieved December 4, 2020.fuser – Shell and Utilities Reference,The Single UNIX Specification, Version 5 fromThe Open Group