{
    "content": [
        {
            "type": "text",
            "text": "# fuser (man)\n\n## NAME\n\nfuser - identify processes using files or sockets\n\n## SYNOPSIS\n\nfuser [-fuv] [-a|-s] [-4|-6] [-c|-m|-n space] [ -k [-i] [-M] [-w] [-SIGNAL] ] name ...\n\n## DESCRIPTION\n\nfuser  displays  the PIDs of processes using the specified files or file systems.  In the de‐\nfault display mode, each file name is followed by a letter denoting the type of access:\n\n## TLDR\n\n> Display process IDs currently using files or sockets.\n\n- Find which processes are accessing a file or directory:\n  `fuser {{path/to/file_or_directory}}`\n- Show more fields (`USER`, `PID`, `ACCESS`, and `COMMAND`):\n  `fuser {{-v|--verbose}} {{path/to/file_or_directory}}`\n- Identify processes using a TCP socket:\n  `fuser {{port}}/tcp`\n- Kill all processes accessing a file or directory (sends the `SIGKILL` signal):\n  `fuser {{-k|--kill}} {{path/to/file_or_directory}}`\n- Find which processes are accessing the filesystem containing a specific file or directory:\n  `fuser {{-m|--mount}} {{path/to/file_or_directory}}`\n- Kill all processes with a TCP connection on a specific port:\n  `fuser {{-k|--kill}} {{port}}/tcp`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS** (2 subsections)\n- **DESCRIPTION**\n- **OPTIONS** (17 subsections)\n- **FILES**\n- **EXAMPLES** (2 subsections)\n- **RESTRICTIONS**\n- **BUGS** (1 subsections)\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "fuser",
        "section": "",
        "mode": "man",
        "summary": "fuser - identify processes using files or sockets",
        "synopsis": "fuser [-fuv] [-a|-s] [-4|-6] [-c|-m|-n space] [ -k [-i] [-M] [-w] [-SIGNAL] ] name ...",
        "tldr_summary": "Display process IDs currently using files or sockets.",
        "tldr_examples": [
            {
                "description": "Find which processes are accessing a file or directory",
                "command": "fuser {{path/to/file_or_directory}}"
            },
            {
                "description": "Show more fields (`USER`, `PID`, `ACCESS`, and `COMMAND`)",
                "command": "fuser {{-v|--verbose}} {{path/to/file_or_directory}}"
            },
            {
                "description": "Identify processes using a TCP socket",
                "command": "fuser {{port}}/tcp"
            },
            {
                "description": "Kill all processes accessing a file or directory (sends the `SIGKILL` signal)",
                "command": "fuser {{-k|--kill}} {{path/to/file_or_directory}}"
            },
            {
                "description": "Find which processes are accessing the filesystem containing a specific file or directory",
                "command": "fuser {{-m|--mount}} {{path/to/file_or_directory}}"
            },
            {
                "description": "Kill all processes with a TCP connection on a specific port",
                "command": "fuser {{-k|--kill}} {{port}}/tcp"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-a",
                "long": "--all",
                "arg": null,
                "description": "Show all files specified on the command line. By default, only files that are ac‐ cessed by at least one process are shown."
            },
            {
                "flag": "-m",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-f",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-k",
                "long": "--kill",
                "arg": null,
                "description": "Kill processes accessing the file. Unless changed with -SIGNAL, SIGKILL is sent. An fuser process never kills itself, but may kill other fuser processes. The effective user ID of the process executing fuser is set to its real user ID before attempting to kill."
            },
            {
                "flag": "-i",
                "long": "--interactive",
                "arg": null,
                "description": "Ask the user for confirmation before killing a process. This option is silently ig‐ nored if -k is not present too."
            },
            {
                "flag": "-I",
                "long": "--inode",
                "arg": null,
                "description": "For the name space file let all comparisons be based on the inodes of the specified file(s) and never on the file names even on network based file systems."
            },
            {
                "flag": "-l",
                "long": "--list-signals",
                "arg": null,
                "description": "List all known signal names."
            },
            {
                "flag": "-m",
                "long": "--mount",
                "arg": null,
                "description": "NAME 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 is speci‐ fied, it is automatically changed to NAME/ to use any file system that might be mounted on that directory."
            },
            {
                "flag": "-M",
                "long": "--ismountpoint",
                "arg": null,
                "description": "Request will be fulfilled only if NAME specifies a mountpoint. This is an invaluable seat belt which prevents you from killing the machine if NAME happens to not be a filesystem."
            },
            {
                "flag": "-k",
                "long": null,
                "arg": null,
                "description": "not present too."
            },
            {
                "flag": "-n",
                "long": "--namespace",
                "arg": null,
                "description": "Select a different name space. The name spaces file (file names, the default), udp (local UDP ports), and tcp (local TCP ports) are supported. For ports, either the port number or the symbolic name can be specified. If there is no ambiguity, the shortcut notation name/space (e.g., 80/tcp) can be used."
            },
            {
                "flag": "-s",
                "long": "--silent",
                "arg": null,
                "description": "Silent operation. -u and -v are ignored in this mode. -a must not be used with -s. -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). This option is silently ignored if the -k option is not used."
            },
            {
                "flag": "-u",
                "long": "--user",
                "arg": null,
                "description": "Append the user name of the process owner to each PID."
            },
            {
                "flag": "-v",
                "long": "--verbose",
                "arg": null,
                "description": "Verbose mode. Processes are shown in a ps-like style. The fields PID, USER and COM‐ MAND are similar to ps. ACCESS shows how the process accesses the file. Verbose mode will also show when a particular file is being accessed as a mount point, knfs export or swap file. In this case kernel is shown instead of the PID."
            },
            {
                "flag": "-V",
                "long": "--version",
                "arg": null,
                "description": "Display version information."
            },
            {
                "flag": "-4",
                "long": "--ipv4",
                "arg": null,
                "description": "Search only for IPv4 sockets. This option must not be used with the -6 option and only has an effect with the tcp and udp namespaces."
            },
            {
                "flag": "-6",
                "long": "--ipv6",
                "arg": null,
                "description": "Search only for IPv6 sockets. This option must not be used with the -4 option and only has an effect with the tcp and udp namespaces. - Reset all options and set the signal back to SIGKILL."
            }
        ],
        "examples": [
            "kills all processes accessing the file system /home in any way.",
            "if fuser -s /dev/ttyS1; then :; else command; fi",
            "invokes command if no other process is using /dev/ttyS1.",
            "shows all processes at the (local) TELNET port."
        ],
        "see_also": [
            {
                "name": "kill",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/kill/1/json"
            },
            {
                "name": "killall",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/killall/1/json"
            },
            {
                "name": "lsof",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/lsof/8/json"
            },
            {
                "name": "pkill",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pkill/1/json"
            },
            {
                "name": "ps",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/ps/1/json"
            },
            {
                "name": "kill",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/kill/2/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "fuser -l",
                        "lines": 1
                    },
                    {
                        "name": "fuser -V",
                        "lines": 1
                    }
                ]
            },
            {
                "name": "DESCRIPTION",
                "lines": 26,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-a --all",
                        "lines": 3,
                        "flag": "-a",
                        "long": "--all"
                    },
                    {
                        "name": "-c -m",
                        "lines": 1,
                        "flag": "-m"
                    },
                    {
                        "name": "-f",
                        "lines": 1,
                        "flag": "-f"
                    },
                    {
                        "name": "-k --kill",
                        "lines": 5,
                        "flag": "-k",
                        "long": "--kill"
                    },
                    {
                        "name": "-i --interactive",
                        "lines": 3,
                        "flag": "-i",
                        "long": "--interactive"
                    },
                    {
                        "name": "-I --inode",
                        "lines": 3,
                        "flag": "-I",
                        "long": "--inode"
                    },
                    {
                        "name": "-l --list-signals",
                        "lines": 2,
                        "flag": "-l",
                        "long": "--list-signals"
                    },
                    {
                        "name": "-m --mount",
                        "lines": 5,
                        "flag": "-m",
                        "long": "--mount"
                    },
                    {
                        "name": "-M --ismountpoint",
                        "lines": 4,
                        "flag": "-M",
                        "long": "--ismountpoint"
                    },
                    {
                        "name": "-w -k",
                        "lines": 2,
                        "flag": "-k"
                    },
                    {
                        "name": "-n --namespace",
                        "lines": 5,
                        "flag": "-n",
                        "long": "--namespace"
                    },
                    {
                        "name": "-s --silent",
                        "lines": 7,
                        "flag": "-s",
                        "long": "--silent"
                    },
                    {
                        "name": "-u --user",
                        "lines": 2,
                        "flag": "-u",
                        "long": "--user"
                    },
                    {
                        "name": "-v --verbose",
                        "lines": 5,
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-V --version",
                        "lines": 2,
                        "flag": "-V",
                        "long": "--version"
                    },
                    {
                        "name": "-4 --ipv4",
                        "lines": 3,
                        "flag": "-4",
                        "long": "--ipv4"
                    },
                    {
                        "name": "-6 --ipv6",
                        "lines": 5,
                        "flag": "-6",
                        "long": "--ipv6"
                    }
                ]
            },
            {
                "name": "FILES",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 1,
                "subsections": [
                    {
                        "name": "fuser -km /home",
                        "lines": 5
                    },
                    {
                        "name": "fuser telnet/tcp",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "RESTRICTIONS",
                "lines": 25,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 4,
                "subsections": [
                    {
                        "name": "-M",
                        "lines": 1,
                        "flag": "-M"
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "fuser - identify processes using files or sockets\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "fuser [-fuv] [-a|-s] [-4|-6] [-c|-m|-n space] [ -k [-i] [-M] [-w] [-SIGNAL] ] name ...",
                "subsections": [
                    {
                        "name": "fuser -l",
                        "content": ""
                    },
                    {
                        "name": "fuser -V",
                        "content": ""
                    }
                ]
            },
            "DESCRIPTION": {
                "content": "fuser  displays  the PIDs of processes using the specified files or file systems.  In the de‐\nfault display mode, each file name is followed by a letter denoting the type of access:\n\nc      current directory.\ne      executable being run.\nf      open file.  f is omitted in default display mode.\nF      open file for writing.  F is omitted in default display mode.\nr      root directory.\nm      mmap'ed file or shared library.\n.      Placeholder, omitted in default display mode.\n\nfuser returns a non-zero return code if none of the specified files is accessed or in case of\na fatal error.  If at least one access has been found, fuser returns zero.\n\nIn  order to look up processes using TCP and UDP sockets, the corresponding name space has to\nbe selected with the -n option. By default fuser will look in both IPv6 and IPv4 sockets.  To\nchange  the  default  behavior, use the -4 and -6 options.  The socket(s) can be specified by\nthe local and remote port, and the remote address.  All fields are optional,  but  commas  in\nfront of missing fields must be present:\n\n[lclport][,[rmthost][,[rmtport]]]\n\nEither symbolic or numeric values can be used for IP addresses and port numbers.\n\nfuser outputs only the PIDs to stdout, everything else is sent to stderr.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "-a --all",
                        "content": "Show  all  files  specified  on the command line.  By default, only files that are ac‐\ncessed by at least one process are shown.\n",
                        "flag": "-a",
                        "long": "--all"
                    },
                    {
                        "name": "-c -m",
                        "content": "",
                        "flag": "-m"
                    },
                    {
                        "name": "-f",
                        "content": "",
                        "flag": "-f"
                    },
                    {
                        "name": "-k --kill",
                        "content": "Kill processes accessing the file.  Unless changed with -SIGNAL, SIGKILL is sent.   An\nfuser  process  never kills itself, but may kill other fuser processes.  The effective\nuser ID of the process executing fuser is set to its real user ID before attempting to\nkill.\n",
                        "flag": "-k",
                        "long": "--kill"
                    },
                    {
                        "name": "-i --interactive",
                        "content": "Ask  the  user for confirmation before killing a process.  This option is silently ig‐\nnored if -k is not present too.\n",
                        "flag": "-i",
                        "long": "--interactive"
                    },
                    {
                        "name": "-I --inode",
                        "content": "For the name space file let all comparisons be based on the inodes  of  the  specified\nfile(s) and never on the file names even on network based file systems.\n",
                        "flag": "-I",
                        "long": "--inode"
                    },
                    {
                        "name": "-l --list-signals",
                        "content": "List all known signal names.\n",
                        "flag": "-l",
                        "long": "--list-signals"
                    },
                    {
                        "name": "-m --mount",
                        "content": "NAME specifies a file on a mounted file system or a block device that is mounted.  All\nprocesses accessing files on that file system are listed.  If a  directory  is  speci‐\nfied,  it  is  automatically  changed  to  NAME/  to use any file system that might be\nmounted on that directory.\n",
                        "flag": "-m",
                        "long": "--mount"
                    },
                    {
                        "name": "-M --ismountpoint",
                        "content": "Request will be fulfilled only if NAME specifies a mountpoint.  This is an  invaluable\nseat  belt  which  prevents  you  from killing the machine if NAME happens to not be a\nfilesystem.\n",
                        "flag": "-M",
                        "long": "--ismountpoint"
                    },
                    {
                        "name": "-w -k",
                        "content": "not present too.\n",
                        "flag": "-k"
                    },
                    {
                        "name": "-n --namespace",
                        "content": "Select  a  different  name space.  The name spaces file (file names, the default), udp\n(local UDP ports), and tcp (local TCP ports) are supported.   For  ports,  either  the\nport  number  or  the  symbolic  name can be specified.  If there is no ambiguity, the\nshortcut notation name/space (e.g., 80/tcp) can be used.\n",
                        "flag": "-n",
                        "long": "--namespace"
                    },
                    {
                        "name": "-s --silent",
                        "content": "Silent operation.  -u and -v are ignored in this mode.  -a must not be used with -s.\n\n-SIGNAL\nUse the specified signal instead of SIGKILL when killing processes.   Signals  can  be\nspecified  either  by  name  (e.g.,  -HUP)  or  by  number (e.g., -1).  This option is\nsilently ignored if the -k option is not used.\n",
                        "flag": "-s",
                        "long": "--silent"
                    },
                    {
                        "name": "-u --user",
                        "content": "Append the user name of the process owner to each PID.\n",
                        "flag": "-u",
                        "long": "--user"
                    },
                    {
                        "name": "-v --verbose",
                        "content": "Verbose mode.  Processes are shown in a ps-like style.  The fields PID, USER and  COM‐\nMAND are similar to ps.  ACCESS shows how the process accesses the file.  Verbose mode\nwill also show when a particular file is being accessed as a mount point, knfs  export\nor swap file.  In this case kernel is shown instead of the PID.\n",
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-V --version",
                        "content": "Display version information.\n",
                        "flag": "-V",
                        "long": "--version"
                    },
                    {
                        "name": "-4 --ipv4",
                        "content": "Search  only  for  IPv4  sockets.  This option must not be used with the -6 option and\nonly has an effect with the tcp and udp namespaces.\n",
                        "flag": "-4",
                        "long": "--ipv4"
                    },
                    {
                        "name": "-6 --ipv6",
                        "content": "Search only for IPv6 sockets.  This option must not be used with  the  -4  option  and\nonly has an effect with the tcp and udp namespaces.\n\n-      Reset all options and set the signal back to SIGKILL.\n",
                        "flag": "-6",
                        "long": "--ipv6"
                    }
                ]
            },
            "FILES": {
                "content": "/proc  location of the proc file system\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "",
                "subsections": [
                    {
                        "name": "fuser -km /home",
                        "content": "kills all processes accessing the file system /home in any way.\n\nif fuser -s /dev/ttyS1; then :; else command; fi\ninvokes command if no other process is using /dev/ttyS1.\n"
                    },
                    {
                        "name": "fuser telnet/tcp",
                        "content": "shows all processes at the (local) TELNET port.\n"
                    }
                ]
            },
            "RESTRICTIONS": {
                "content": "Processes accessing the same file or file system several times in the same way are only shown\nonce.\n\nIf the same object is specified several times on the command line, some of those entries  may\nbe ignored.\n\nfuser may only be able to gather partial information unless run with privileges.  As a conse‐\nquence, files opened by processes belonging to other users may not be listed and  executables\nmay be classified as mapped only.\n\nfuser  cannot report on any processes that it doesn't have permission to look at the file de‐\nscriptor table for.  The most common time this problem occurs is when looking for TCP or  UDP\nsockets when running fuser as a non-root user.  In this case fuser will report no access.\n\nInstalling  fuser  SUID root will avoid problems associated with partial information, but may\nbe undesirable for security and privacy reasons.\n\nudp and tcp name spaces, and UNIX domain sockets can't be searched with  kernels  older  than\n1.3.78.\n\nAccesses by the kernel are only shown with the -v option.\n\nThe  -k  option  only works on processes.  If the user is the kernel, fuser will print an ad‐\nvice, but take no action beyond that.\n",
                "subsections": []
            },
            "BUGS": {
                "content": "fuser -m /dev/sgX will show (or kill with the -k flag) all processes, even if you don't  have\nthat device configured.  There may be other devices it does this for too.\n\nThe mount -m option will match any file within the same device as the specified file, use the",
                "subsections": [
                    {
                        "name": "-M",
                        "content": "",
                        "flag": "-M"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "kill(1), killall(1), lsof(8), pkill(1), ps(1), kill(2).\n\n\n\npsmisc                                       2020-09-09                                     FUSER(1)",
                "subsections": []
            }
        }
    }
}