1FUSER(P) POSIX Programmer's Manual FUSER(P)
2
3
4
6 fuser - list process IDs of all processes that have one or more files
7 open
8
10 fuser [ -cfu ] file ...
11
13 The fuser utility shall write to standard output the process IDs of
14 processes running on the local system that have one or more named files
15 open. For block special devices, all processes using any file on that
16 device are listed.
17
18 The fuser utility shall write to standard error additional information
19 about the named files indicating how the file is being used.
20
21 Any output for processes running on remote systems that have a named
22 file open is unspecified.
23
24 A user may need appropriate privilege to invoke the fuser utility.
25
27 The fuser utility shall conform to the Base Definitions volume of
28 IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines.
29
30 The following options shall be supported:
31
32 -c The file is treated as a mount point and the utility shall
33 report on any files open in the file system.
34
35 -f The report shall be only for the named files.
36
37 -u The user name, in parentheses, associated with each process ID
38 written to standard output shall be written to standard error.
39
40
42 The following operand shall be supported:
43
44 file A pathname on which the file or file system is to be reported.
45
46
48 Not used.
49
51 The user database.
52
54 The following environment variables shall affect the execution of
55 fuser:
56
57 LANG Provide a default value for the internationalization variables
58 that are unset or null. (See the Base Definitions volume of
59 IEEE Std 1003.1-2001, Section 8.2, Internationalization Vari‐
60 ables for the precedence of internationalization variables used
61 to determine the values of locale categories.)
62
63 LC_ALL If set to a non-empty string value, override the values of all
64 the other internationalization variables.
65
66 LC_CTYPE
67 Determine the locale for the interpretation of sequences of
68 bytes of text data as characters (for example, single-byte as
69 opposed to multi-byte characters in arguments).
70
71 LC_MESSAGES
72 Determine the locale that should be used to affect the format
73 and contents of diagnostic messages written to standard error.
74
75 NLSPATH
76 Determine the location of message catalogs for the processing of
77 LC_MESSAGES .
78
79
81 Default.
82
84 The fuser utility shall write the process ID for each process using
85 each file given as an operand to standard output in the following for‐
86 mat:
87
88
89 "%d", <process_id>
90
92 The fuser utility shall write diagnostic messages to standard error.
93
94 The fuser utility also shall write the following to standard error:
95
96 * The pathname of each named file is written followed immediately by a
97 colon.
98
99 * For each process ID written to standard output, the character 'c'
100 shall be written to standard error if the process is using the file
101 as its current directory and the character 'r' shall be written to
102 standard error if the process is using the file as its root direc‐
103 tory. Implementations may write other alphabetic characters to indi‐
104 cate other uses of files.
105
106 * When the -u option is specified, characters indicating the use of
107 the file shall be followed immediately by the user name, in paren‐
108 theses, corresponding to the process' real user ID. If the user
109 name cannot be resolved from the process' real user ID, the process'
110 real user ID shall be written instead of the user name.
111
112 When standard output and standard error are directed to the same file,
113 the output shall be interleaved so that the filename appears at the
114 start of each line, followed by the process ID and characters indicat‐
115 ing the use of the file. Then, if the -u option is specified, the user
116 name or user ID for each process using that file shall be written.
117
118 A <newline> shall be written to standard error after the last output
119 described above for each file operand.
120
122 None.
123
125 None.
126
128 The following exit values shall be returned:
129
130 0 Successful completion.
131
132 >0 An error occurred.
133
134
136 Default.
137
138 The following sections are informative.
139
141 None.
142
144 The command:
145
146
147 fuser -fu .
148
149 writes to standard output the process IDs of processes that are using
150 the current directory and writes to standard error an indication of how
151 those processes are using the directory and the user names associated
152 with the processes that are using the current directory.
153
155 The definition of the fuser utility follows existing practice.
156
158 None.
159
161 None.
162
164 Portions of this text are reprinted and reproduced in electronic form
165 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
166 -- Portable Operating System Interface (POSIX), The Open Group Base
167 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
168 Electrical and Electronics Engineers, Inc and The Open Group. In the
169 event of any discrepancy between this version and the original IEEE and
170 The Open Group Standard, the original IEEE and The Open Group Standard
171 is the referee document. The original Standard can be obtained online
172 at http://www.opengroup.org/unix/online.html .
173
174
175
176IEEE/The Open Group 2003 FUSER(P)