1fuser(1M) System Administration Commands fuser(1M)
2
3
4
6 fuser - identify users of files and devices
7
9 /usr/sbin/fuser [-c | -d | -f] [-nu] [-k | -s sig] files
10 [ [- ] [-c | -d | -f] [-nu] [-k | -s sig] files] ...
11
12
14 The fuser utility displays the process IDs of the processes that are
15 using the files specified as arguments.
16
17
18 Each process ID is followed by a letter code. These letter codes are
19 interpreted as follows. If the process is using the file as
20
21 c Indicates that the process is using the file as its current direc‐
22 tory.
23
24
25 m Indicates that the process is using a file mapped with mmap(2).
26 See mmap(2) for details.
27
28
29 n Indicates that the process is holding a non-blocking mandatory
30 lock on the file.
31
32
33 o Indicates that the process is using the file as an open file.
34
35
36 r Indicates that the process is using the file as its root direc‐
37 tory.
38
39
40 t Indicates that the process is using the file as its text file.
41
42
43 y Indicates that the process is using the file as its controlling
44 terminal.
45
46
47
48 For block special devices with mounted file systems, all processes
49 using any file on that device are listed. For all types of files (text
50 files, executables, directories, devices, and so forth), only the pro‐
51 cesses using that file are reported.
52
53
54 For all types of devices, fuser also displays any known kernel con‐
55 sumers that have the device open. Kernel consumers are displayed in one
56 of the following formats:
57
58 [module_name]
59 [module_name,dev_path=path]
60 [module_name,dev=(major,minor)]
61 [module_name,dev=(major,minor),dev_path=path]
62
63
64
65
66 If more than one group of files are specified, the options may be
67 respecified for each additional group of files. A lone dash cancels the
68 options currently in force.
69
70
71 The process IDs are printed as a single line on the standard output,
72 separated by spaces and terminated with a single new line. All other
73 output is written on standard error.
74
75
76 Any user can run fuser, but only the superuser can terminate another
77 user's process.
78
80 The following options are supported:
81
82 -c Reports on files that are mount points for file systems, and
83 any files within that mounted file system.
84
85
86 -d Report device usage information for all minor nodes bound to
87 the same device node as the specified minor node. This option
88 does not report file usage for files within a mounted file
89 system.
90
91
92 -f Prints a report for the named file, not for files within a
93 mounted file system.
94
95
96 -k Sends the SIGKILL signal to each process. Since this option
97 spawns kills for each process, the kill messages may not show
98 up immediately (see kill(2)). No signals will be sent to ker‐
99 nel file consumers.
100
101
102 -n Lists only processes with non-blocking mandatory locks on a
103 file.
104
105
106 -s sig Sends a signal to each process. The sig option argument spec‐
107 ifies one of the symbolic names defined in the <signal.h>
108 header, or a decimal integer signal number. If sig is a sym‐
109 bolic name, it is recognized in a case-independent fashion,
110 without the SIG prefix. The -k option is equivalent to -s
111 KILL or -s 9. No signals will be sent to kernel file con‐
112 sumers.
113
114
115 -u Displays the user login name in parentheses following the
116 process ID.
117
118
120 Example 1 Reporting on the Mount Point and Files
121
122
123 The following example reports on the mount point and files within the
124 mounted file system.
125
126
127 example% fuser -c /export/foo
128
129
130
131 Example 2 Restricting Output when Reporting on the Mount Point and
132 Files
133
134
135 The following example reports on the mount point and files within the
136 mounted file system, but the output is restricted to processes that
137 hold non-blocking mandatory locks.
138
139
140 example% fuser -cn /export/foo
141
142
143
144 Example 3 Sending SIGTERM to Processes Holding a Non-blocking Mandatory
145 Lock
146
147
148 The following command sends SIGTERM to any processes that hold a non-
149 blocking mandatory lock on file /export/foo/my_file.
150
151
152 example% fuser -fn -s term /export/foo/my_file
153
154
155
157 See environ(5) for descriptions of the following environment variables
158 that affect the execution of fuser: LANG, LC_ALL LC_CTYPE, LC_MESSAGES,
159 and NLSPATH.
160
162 See attributes(5) for descriptions of the following attributes:
163
164
165
166
167 ┌─────────────────────────────┬─────────────────────────────┐
168 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
169 ├─────────────────────────────┼─────────────────────────────┤
170 │Availability │SUNWcsu │
171 ├─────────────────────────────┼─────────────────────────────┤
172 │Interface Stability │Standard │
173 └─────────────────────────────┴─────────────────────────────┘
174
176 ps(1), mount(1M), kill(2), mmap(2), signal(3C), attributes(5), envi‐
177 ron(5), standards(5)
178
180 Because fuser works with a snapshot of the system image, it may miss
181 processes that begin using a file while fuser is running. Also, pro‐
182 cesses reported as using a file may have stopped using it while fuser
183 was running. These factors should discourage the use of the -k option.
184
185
186
187SunOS 5.11 21 Oct 2003 fuser(1M)