6324 Add an `ndp' tool for manipulating the neighbors table
[illumos-gate.git] / usr / src / man / man1m / fuser.1m
blob66f371e2c81970bab81a01036af4b827b7bef470
1 '\" te
2 .\"  Copyright 1989 AT&T Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH FUSER 1M "Oct 21, 2003"
7 .SH NAME
8 fuser \- identify users of files and devices
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fB/usr/sbin/fuser\fR [\fB-c\fR | \fB-d\fR | \fB-f\fR] [\fB-nu\fR] [\fB-k\fR | \fB-s\fR \fIsig\fR] \fIfiles\fR
13      [ [\fB- \fR] [\fB-c\fR | \fB-d\fR | \fB-f\fR] [\fB-nu\fR] [\fB-k\fR | \fB-s\fR \fIsig\fR] \fIfiles\fR] ...
14 .fi
16 .SH DESCRIPTION
17 .sp
18 .LP
19 The \fBfuser\fR utility displays the process \fBID\fRs of the processes that
20 are using the \fIfiles\fR specified as arguments.
21 .sp
22 .LP
23 Each process \fBID\fR is followed by a letter code. These letter codes are
24 interpreted as follows. If the process is using the file as
25 .sp
26 .ne 2
27 .na
28 \fB\fBc\fR\fR
29 .ad
30 .RS 5n
31 Indicates that the process is using the file as its current directory.
32 .RE
34 .sp
35 .ne 2
36 .na
37 \fB\fBm\fR\fR
38 .ad
39 .RS 5n
40 Indicates that the process is using a file mapped with \fBmmap\fR(2). See
41 \fBmmap\fR(2) for details.
42 .RE
44 .sp
45 .ne 2
46 .na
47 \fB\fBn\fR\fR
48 .ad
49 .RS 5n
50 Indicates that the process is holding a non-blocking mandatory lock on the
51 file.
52 .RE
54 .sp
55 .ne 2
56 .na
57 \fB\fBo\fR\fR
58 .ad
59 .RS 5n
60 Indicates that the process is using the file as an open file.
61 .RE
63 .sp
64 .ne 2
65 .na
66 \fB\fBr\fR\fR
67 .ad
68 .RS 5n
69 Indicates that the process is using the file as its root directory.
70 .RE
72 .sp
73 .ne 2
74 .na
75 \fB\fBt\fR\fR
76 .ad
77 .RS 5n
78 Indicates that the process is using the file as its text file.
79 .RE
81 .sp
82 .ne 2
83 .na
84 \fB\fBy\fR\fR
85 .ad
86 .RS 5n
87 Indicates that the process is using the file as its controlling terminal.
88 .RE
90 .sp
91 .LP
92 For block special devices with mounted file systems, all processes using any
93 file on that device are listed. For all types of files (text files,
94 executables, directories, devices, and so forth), only the processes using that
95 file are reported.
96 .sp
97 .LP
98 For all types of devices, \fBfuser\fR also displays any known kernel consumers
99 that have the device open. Kernel consumers are displayed in one of the
100 following formats:
102 .in +2
104 [\fImodule_name\fR]
105 [\fImodule_name\fR,dev_path=\fIpath\fR]
106 [\fImodule_name\fR,dev=(\fImajor\fR,\fIminor\fR)]
107 [\fImodule_name\fR,dev=(\fImajor\fR,\fIminor\fR),dev_path=\fIpath\fR]
109 .in -2
114 If more than one group of files are specified, the options may be respecified
115 for each additional group of files. A lone dash cancels the options currently
116 in force.
119 The process IDs are printed as a single line on the standard output, separated
120 by spaces and terminated with a single new line. All other output is written on
121 standard error.
124 Any user can run fuser, but only the superuser can terminate another user's
125 process.
126 .SH OPTIONS
129 The following options are supported:
131 .ne 2
133 \fB\fB-c\fR\fR
135 .RS 10n
136 Reports on files that are mount points for file systems, and any files within
137 that mounted file system.
141 .ne 2
143 \fB\fB-d\fR\fR
145 .RS 10n
146 Report device usage information for all minor nodes bound to the same device
147 node as the specified minor node. This option does not report file usage for
148 files within a mounted file system.
152 .ne 2
154 \fB\fB-f\fR\fR
156 .RS 10n
157 Prints a report for the named file, not for files within a mounted file system.
161 .ne 2
163 \fB\fB-k\fR\fR
165 .RS 10n
166 Sends the \fBSIGKILL\fR signal to each process. Since this option spawns kills
167 for each process, the kill messages may not show up immediately (see
168 \fBkill\fR(2)). No signals will be sent to kernel file consumers.
172 .ne 2
174 \fB\fB-n\fR\fR
176 .RS 10n
177 Lists only processes with non-blocking mandatory locks on a file.
181 .ne 2
183 \fB\fB-s\fR \fIsig\fR\fR
185 .RS 10n
186 Sends a signal to each process. The \fIsig\fR option argument specifies one of
187 the symbolic names defined in the \fB<signal.h>\fR header, or a decimal integer
188 signal number. If \fIsig\fR is a symbolic name, it is recognized in a
189 case-independent fashion, without the \fBSIG\fR prefix. The \fB-k\fR option is
190 equivalent to \fB-s\fR \fBKILL\fR or \fB-s\fR \fB9\fR. No signals will be sent
191 to kernel file consumers.
195 .ne 2
197 \fB\fB-u\fR\fR
199 .RS 10n
200 Displays the user login name in parentheses following the process \fBID\fR.
203 .SH EXAMPLES
205 \fBExample 1 \fRReporting on the Mount Point and Files
208 The following example reports on the mount point and files within the mounted
209 file system.
212 .in +2
214 example% \fBfuser -c /export/foo\fR
216 .in -2
220 \fBExample 2 \fRRestricting Output when Reporting on the Mount Point and Files
223 The following example reports on the mount point and files within the mounted
224 file system, but the output is restricted to processes that hold non-blocking
225 mandatory locks.
228 .in +2
230 example% \fBfuser -cn /export/foo\fR
232 .in -2
236 \fBExample 3 \fRSending SIGTERM to Processes Holding a Non-blocking Mandatory
237 Lock
240 The following command sends \fBSIGTERM\fR to any processes that hold a
241 non-blocking mandatory lock on file \fB/export/foo/my_file\fR.
244 .in +2
246 example% \fBfuser -fn -s term /export/foo/my_file\fR
248 .in -2
251 .SH ENVIRONMENT VARIABLES
254 See \fBenviron\fR(5) for descriptions of the following environment variables
255 that affect the execution of \fBfuser\fR: \fBLANG\fR, \fBLC_ALL\fR
256 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
257 .SH ATTRIBUTES
260 See \fBattributes\fR(5) for descriptions of the following attributes:
265 box;
266 c | c
267 l | l .
268 ATTRIBUTE TYPE  ATTRIBUTE VALUE
270 Interface Stability     Standard
273 .SH SEE ALSO
276 \fBps\fR(1), \fBmount\fR(1M), \fBkill\fR(2), \fBmmap\fR(2), \fBsignal\fR(3C),
277 \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5)
278 .SH NOTES
281 Because \fBfuser\fR works with a snapshot of the system image, it may miss
282 processes that begin using a file while \fBfuser\fR is running. Also, processes
283 reported as using a file may have stopped using it while \fBfuser\fR was
284 running. These factors should discourage the use of the \fB-k\fR option.