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