1FUSER(1P)                  POSIX Programmer's Manual                 FUSER(1P)
2
3
4

PROLOG

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
11

NAME

13       fuser — list process IDs of all processes that have one or  more  files
14       open
15

SYNOPSIS

17       fuser [−cfu] file...
18

DESCRIPTION

20       The  fuser  utility  shall  write to standard output the process IDs of
21       processes running on the local system that have one or more named files
22       open.   For block special devices, all processes using any file on that
23       device are listed.
24
25       The fuser utility shall write to standard error additional  information
26       about the named files indicating how the file is being used.
27
28       Any  output  for  processes running on remote systems that have a named
29       file open is unspecified.
30
31       A user may need appropriate privileges to invoke the fuser utility.
32

OPTIONS

34       The fuser utility shall conform  to  the  Base  Definitions  volume  of
35       POSIX.1‐2008, Section 12.2, Utility Syntax Guidelines.
36
37       The following options shall be supported:
38
39       −c        The  file  is  treated as a mount point and the utility shall
40                 report on any files open in the file system.
41
42       −f        The report shall be only for the named files.
43
44       −u        The user name, in parentheses, associated with  each  process
45                 ID  written  to  standard output shall be written to standard
46                 error.
47

OPERANDS

49       The following operand shall be supported:
50
51       file      A pathname on  which  the  file  or  file  system  is  to  be
52                 reported.
53

STDIN

55       Not used.
56

INPUT FILES

58       The user database.
59

ENVIRONMENT VARIABLES

61       The  following  environment  variables  shall  affect  the execution of
62       fuser:
63
64       LANG      Provide a default value for  the  internationalization  vari‐
65                 ables  that are unset or null. (See the Base Definitions vol‐
66                 ume of POSIX.1‐2008, Section 8.2, Internationalization  Vari‐
67                 ables  for  the  precedence of internationalization variables
68                 used to determine the values of locale categories.)
69
70       LC_ALL    If set to a non-empty string value, override  the  values  of
71                 all the other internationalization variables.
72
73       LC_CTYPE  Determine  the  locale for the interpretation of sequences of
74                 bytes of text data as characters (for example, single-byte as
75                 opposed to multi-byte characters in arguments).
76
77       LC_MESSAGES
78                 Determine the locale that should be used to affect the format
79                 and contents  of  diagnostic  messages  written  to  standard
80                 error.
81
82       NLSPATH   Determine the location of message catalogs for the processing
83                 of LC_MESSAGES.
84

ASYNCHRONOUS EVENTS

86       Default.
87

STDOUT

89       The fuser utility shall write the process ID  for  each  process  using
90       each  file given as an operand to standard output in the following for‐
91       mat:
92
93           "%d", <process_id>
94

STDERR

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

OUTPUT FILES

127       None.
128

EXTENDED DESCRIPTION

130       None.
131

EXIT STATUS

133       The following exit values shall be returned:
134
135        0    Successful completion.
136
137       >0    An error occurred.
138

CONSEQUENCES OF ERRORS

140       Default.
141
142       The following sections are informative.
143

APPLICATION USAGE

145       None.
146

EXAMPLES

148       The command:
149
150           fuser −fu .
151
152       writes to standard output the process IDs of processes that  are  using
153       the current directory and writes to standard error an indication of how
154       those processes are using the directory and the user  names  associated
155       with the processes that are using the current directory.
156
157           fuser −c <mount point>
158
159       writes  to  standard output the process IDs of processes that are using
160       any file in the file system which  is  mounted  on  <mount  point>  and
161       writes to standard error an indication of how those processes are using
162       the files.
163
164           fuser <mount point>
165
166       writes to standard output the process IDs of processes that  are  using
167       the  file  which is named by <mount point> and writes to standard error
168       an indication of how those processes are using the file.
169
170           fuser <block device>
171
172       writes to standard output the process IDs of processes that  are  using
173       any  file  which is on the device named by <block device> and writes to
174       standard error an indication of how those processes are using the file.
175
176           fuser −f <block device>
177
178       writes to standard output the process IDs of processes that  are  using
179       the  file <block device> itself and writes to standard error an indica‐
180       tion of how those processes are using the file.
181

RATIONALE

183       The definition of the fuser utility follows existing practice.
184

FUTURE DIRECTIONS

186       None.
187

SEE ALSO

189       The Base Definitions volume of  POSIX.1‐2008,  Chapter  8,  Environment
190       Variables, Section 12.2, Utility Syntax Guidelines
191
193       Portions  of  this text are reprinted and reproduced in electronic form
194       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
195       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
196       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
197       cal  and  Electronics  Engineers,  Inc  and  The  Open Group.  (This is
198       POSIX.1-2008 with the 2013 Technical Corrigendum  1  applied.)  In  the
199       event of any discrepancy between this version and the original IEEE and
200       The Open Group Standard, the original IEEE and The Open Group  Standard
201       is  the  referee document. The original Standard can be obtained online
202       at http://www.unix.org/online.html .
203
204       Any typographical or formatting errors that appear  in  this  page  are
205       most likely to have been introduced during the conversion of the source
206       files to man page format. To report such errors,  see  https://www.ker
207       nel.org/doc/man-pages/reporting_bugs.html .
208
209
210
211IEEE/The Open Group                  2013                            FUSER(1P)
Impressum