On Unix-like operating systems, the fuser command identifies processes that are currently using files or sockets on the system.

This page describes the GNU/Linux version of fuser.

Description

fuser displays the PIDs of processes using the specified files or file systems.

  • Description
  • Syntax
  • Examples
  • Related commands
  • Linux commands help

In the default display mode, each file name is followed by a letter denoting the type of access:

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 is found, fuser returns zero.

To look up processes using TCP and UDP sockets, the corresponding name space has to be selected with the -n option. By default, fuser looks in both IPv6 and IPv4 sockets. To change the default behavior, use the -4 and -6 options. The socket(s) can be specified by the local and remote port, and the remote address. All fields are optional, but commas in front of missing fields must be present:

[lcl_port][,[rmt_host][,[rmt_port]]]

Either symbolic or numeric values can be used for IP addresses and port numbers.

fuser outputs only the PIDs to stdout, everything else is sent to stderr.

Syntax

fuser [-fuv] [-a|-s] [-4|-6] [-c|-m|-n space] [ -k [-i] [-M] [-w] [-SIGNAL] ] name …

fuser -l

fuser -V

Options

Examples

fuser .

Display every process ID that uses the current directory ("./").

fuser -v .

Display verbose information about every process that uses the current directory. This information includes the name of the user who initiated the process and an indicator of the process name.

fuser -v /

Display verbose information about every process that uses the root directory.

kill — Send a signal to a process, affecting its behavior or killing it.pkill — Send a signal to any process whose attributes match a regular expression.ps — Report the status of a process or processes.