1FUSER(1) User Commands FUSER(1)
2
3
4
6 fuser - identify processes using files or sockets
7
9 fuser [-fuv] [-a|-s] [-4|-6] [-c|-m|-n space] [ -k [-i] [-M] [-w]
10 [-SIGNAL] ] name ...
11 fuser -l
12 fuser -V
13
15 fuser displays the PIDs of processes using the specified files or file
16 systems. In the default display mode, each file name is followed by a
17 letter denoting the type of access:
18
19 c current directory.
20 e executable being run.
21 f open file. f is omitted in default display mode.
22 F open file for writing. F is omitted in default display
23 mode.
24 r root directory.
25 m mmap'ed file or shared library.
26 . Placeholder, omitted in default display mode.
27
28 fuser returns a non-zero return code if none of the specified files is
29 accessed or in case of a fatal error. If at least one access has been
30 found, fuser returns zero.
31
32 In order to look up processes using TCP and UDP sockets, the corre‐
33 sponding name space has to be selected with the -n option. By default
34 fuser will look in both IPv6 and IPv4 sockets. To change the default,
35 behavior, use the -4 and -6 options. The socket(s) can be specified by
36 the local and remote port, and the remote address. All fields are
37 optional, but commas in front of missing fields must be present:
38
39 [lcl_port][,[rmt_host][,[rmt_port]]]
40
41 Either symbolic or numeric values can be used for IP addresses and port
42 numbers.
43
44 fuser outputs only the PIDs to stdout, everything else is sent to
45 stderr.
46
48 -a, --all
49 Show all files specified on the command line. By default, only
50 files that are accessed by at least one process are shown.
51
52 -c Same as -m option, used for POSIX compatibility.
53
54 -f Silently ignored, used for POSIX compatibility.
55
56 -k, --kill
57 Kill processes accessing the file. Unless changed with -SIGNAL,
58 SIGKILL is sent. An fuser process never kills itself, but may
59 kill other fuser processes. The effective user ID of the
60 process executing fuser is set to its real user ID before
61 attempting to kill.
62
63 -i, --interactive
64 Ask the user for confirmation before killing a process. This
65 option is silently ignored if -k is not present too.
66
67 -I, --inode
68 For the name space file let all comparisons be based on the
69 inodes of the specified file(s) and never on the file names even
70 on network based file systems.
71
72 -l, --list-signals
73 List all known signal names.
74
75 -m NAME , --mount NAME
76 NAME specifies a file on a mounted file system or a block device
77 that is mounted. All processes accessing files on that file
78 system are listed. If a directory file is specified, it is
79 automatically changed to NAME/. to use any file system that
80 might be mounted on that directory.
81
82 -M, --ismountpoint
83 Request will be fulfilled only if NAME specifies a mountpoint.
84 This is an invaluable seat belt which prevents you from killing
85 the machine if NAME happens to not be a filesystem.
86
87 -w Kill only processes which have write access. This option is
88 silently ignored if -k is not present too.
89
90 -n SPACE, --namespace SPACE
91 Select a different name space. The name spaces file (file
92 names, the default), udp (local UDP ports), and tcp (local TCP
93 ports) are supported. For ports, either the port number or the
94 symbolic name can be specified. If there is no ambiguity, the
95 shortcut notation name/space (e.g., 80/tcp) can be used.
96
97 -s, --silent
98 Silent operation. -u and -v are ignored in this mode. -a must
99 not be used with -s.
100
101 -SIGNAL
102 Use the specified signal instead of SIGKILL when killing pro‐
103 cesses. Signals can be specified either by name (e.g., -HUP) or
104 by number (e.g., -1). This option is silently ignored if the -k
105 option is not used.
106
107 -u, --user
108 Append the user name of the process owner to each PID.
109
110 -v, --verbose
111
112 Verbose mode. Processes are shown in a ps-like style. The
113 fields PID, USER and COMMAND are similar to ps. ACCESS shows
114 how the process accesses the file. Verbose mode will also show
115 when a particular file is being accessed as a mount point, knfs
116 export or swap file. In this case kernel is shown instead of
117 the PID.
118
119 -V, --version
120 Display version information.
121
122 -4, --ipv4
123 Search only for IPv4 sockets. This option must not be used with
124 the -6 option and only has an effect with the tcp and udp names‐
125 paces.
126
127 -6, --ipv6
128 Search only for IPv6 sockets. This option must not be used with
129 the -4 option and only has an effect with the tcp and udp names‐
130 paces.
131
132 - Reset all options and set the signal back to SIGKILL.
133
135 /proc location of the proc file system
136
138 fuser -km /home
139 kills all processes accessing the file system /home in any way.
140
141 if fuser -s /dev/ttyS1; then :; else something; fi
142 invokes something if no other process is using /dev/ttyS1.
143
144 fuser telnet/tcp
145 shows all processes at the (local) TELNET port.
146
148 Processes accessing the same file or file system several times in the
149 same way are only shown once.
150
151 If the same object is specified several times on the command line, some
152 of those entries may be ignored.
153
154 fuser may only be able to gather partial information unless run with
155 privileges. As a consequence, files opened by processes belonging to
156 other users may not be listed and executables may be classified as
157 mapped only.
158
159 fuser cannot report on any processes that it doesn't have permission to
160 look at the file descriptor table for. The most common time this prob‐
161 lem occurs is when looking for TCP or UDP sockets when running fuser as
162 a non-root user. In this case fuser will report no access.
163
164 Installing fuser SUID root will avoid problems associated with partial
165 information, but may be undesirable for security and privacy reasons.
166
167 udp and tcp name spaces, and UNIX domain sockets can't be searched with
168 kernels older than 1.3.78.
169
170 Accesses by the kernel are only shown with the -v option.
171
172 The -k option only works on processes. If the user is the kernel,
173 fuser will print an advice, but take no action beyond that.
174
176 fuser -m /dev/sgX will show (or kill with the -k flag) all processes,
177 even if you don't have that device configured. There may be other
178 devices it does this for too.
179
180 The mount -m option will match any file within the same device as the
181 specified file, use the -M option as well if you mean to specify only
182 the mount point.
183
185 kill(1), killall(1), lsof(8), pkill(1), ps(1), kill(2).
186
187
188
189psmisc 2016-04-04 FUSER(1)