1FUSER(1P) POSIX Programmer's Manual FUSER(1P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 fuser — list process IDs of all processes that have one or more files
13 open
14
16 fuser [-cfu] file...
17
19 The fuser utility shall write to standard output the process IDs of
20 processes running on the local system that have one or more named files
21 open. For block special devices, all processes using any file on that
22 device are listed.
23
24 The fuser utility shall write to standard error additional information
25 about the named files indicating how the file is being used.
26
27 Any output for processes running on remote systems that have a named
28 file open is unspecified.
29
30 A user may need appropriate privileges to invoke the fuser utility.
31
33 The fuser utility shall conform to the Base Definitions volume of
34 POSIX.1‐2017, Section 12.2, Utility Syntax Guidelines.
35
36 The following options shall be supported:
37
38 -c The file is treated as a mount point and the utility shall
39 report on any files open in the file system.
40
41 -f The report shall be only for the named files.
42
43 -u The user name, in parentheses, associated with each process
44 ID written to standard output shall be written to standard
45 error.
46
48 The following operand shall be supported:
49
50 file A pathname on which the file or file system is to be
51 reported.
52
54 Not used.
55
57 The user database.
58
60 The following environment variables shall affect the execution of
61 fuser:
62
63 LANG Provide a default value for the internationalization vari‐
64 ables that are unset or null. (See the Base Definitions vol‐
65 ume of POSIX.1‐2017, Section 8.2, Internationalization Vari‐
66 ables for the precedence of internationalization variables
67 used to determine the values of locale categories.)
68
69 LC_ALL If set to a non-empty string value, override the values of
70 all the other internationalization variables.
71
72 LC_CTYPE Determine the locale for the interpretation of sequences of
73 bytes of text data as characters (for example, single-byte as
74 opposed to multi-byte characters in arguments).
75
76 LC_MESSAGES
77 Determine the locale that should be used to affect the format
78 and contents of diagnostic messages written to standard
79 error.
80
81 NLSPATH Determine the location of message catalogs for the processing
82 of LC_MESSAGES.
83
85 Default.
86
88 The fuser utility shall write the process ID for each process using
89 each file given as an operand to standard output in the following for‐
90 mat:
91
92
93 "%d", <process_id>
94
96 The fuser utility shall write diagnostic messages to standard error.
97
98 The fuser utility also shall write the following to standard error:
99
100 * The pathname of each named file is written followed immediately by
101 a <colon>.
102
103 * For each process ID written to standard output, the character 'c'
104 shall be written to standard error if the process is using the file
105 as its current directory and the character 'r' shall be written to
106 standard error if the process is using the file as its root direc‐
107 tory. Implementations may write other alphabetic characters to
108 indicate other uses of files.
109
110 * When the -u option is specified, characters indicating the use of
111 the file shall be followed immediately by the user name, in paren‐
112 theses, corresponding to the real user ID of the process. If the
113 user name cannot be resolved from the real user ID of the process,
114 the real user ID of the process shall be written instead of the
115 user name.
116
117 When standard output and standard error are directed to the same file,
118 the output shall be interleaved so that the filename appears at the
119 start of each line, followed by the process ID and characters indicat‐
120 ing the use of the file. Then, if the -u option is specified, the user
121 name or user ID for each process using that file shall be written.
122
123 A <newline> shall be written to standard error after the last output
124 described above for each file operand.
125
127 None.
128
130 None.
131
133 The following exit values shall be returned:
134
135 0 Successful completion.
136
137 >0 An error occurred.
138
140 Default.
141
142 The following sections are informative.
143
145 None.
146
148 The command:
149
150
151 fuser -fu .
152
153 writes to standard output the process IDs of processes that are using
154 the current directory and writes to standard error an indication of how
155 those processes are using the directory and the user names associated
156 with the processes that are using the current directory.
157
158
159 fuser -c <mount point>
160
161 writes to standard output the process IDs of processes that are using
162 any file in the file system which is mounted on <mount point> and
163 writes to standard error an indication of how those processes are using
164 the files.
165
166
167 fuser <mount point>
168
169 writes to standard output the process IDs of processes that are using
170 the file which is named by <mount point> and writes to standard error
171 an indication of how those processes are using the file.
172
173
174 fuser <block device>
175
176 writes to standard output the process IDs of processes that are using
177 any file which is on the device named by <block device> and writes to
178 standard error an indication of how those processes are using the file.
179
180
181 fuser -f <block device>
182
183 writes to standard output the process IDs of processes that are using
184 the file <block device> itself and writes to standard error an indica‐
185 tion of how those processes are using the file.
186
188 The definition of the fuser utility follows existing practice.
189
191 None.
192
194 The Base Definitions volume of POSIX.1‐2017, Chapter 8, Environment
195 Variables, Section 12.2, Utility Syntax Guidelines
196
198 Portions of this text are reprinted and reproduced in electronic form
199 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
200 table Operating System Interface (POSIX), The Open Group Base Specifi‐
201 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
202 Electrical and Electronics Engineers, Inc and The Open Group. In the
203 event of any discrepancy between this version and the original IEEE and
204 The Open Group Standard, the original IEEE and The Open Group Standard
205 is the referee document. The original Standard can be obtained online
206 at http://www.opengroup.org/unix/online.html .
207
208 Any typographical or formatting errors that appear in this page are
209 most likely to have been introduced during the conversion of the source
210 files to man page format. To report such errors, see https://www.ker‐
211 nel.org/doc/man-pages/reporting_bugs.html .
212
213
214
215IEEE/The Open Group 2017 FUSER(1P)