]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - usr.bin/fstat/fuser.1
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / usr.bin / fstat / fuser.1
1 .\" Copyright (c) 2005-2011 Stanislav Sedov <stas@FreeBSD.org>
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd May 13, 2011
28 .Dt FUSER 1
29 .Os
30 .Sh NAME
31 .Nm fuser
32 .Nd list IDs of all processes that have one or more files open
33 .Sh SYNOPSIS
34 .Nm
35 .Op Fl cfkmu
36 .Op Fl M Ar core
37 .Op Fl N Ar system
38 .Op Fl s Ar signal
39 .Ar
40 .Sh DESCRIPTION
41 The
42 .Nm
43 utility writes to stdout the PIDs of processes that have one or
44 more named files open.
45 For block and character special devices, all processes using files
46 on that device are listed.
47 A file is considered open by a process if it was explicitly opened,
48 is the working directory, root directory, jail root directory,
49 active executable text, kernel trace file or the controlling terminal
50 of the process.
51 If
52 .Fl m
53 option is specified, the
54 .Nm
55 utility will also look through mmapped files.
56 .Pp
57 The following options are available:
58 .Bl -tag -width indent
59 .It Fl c
60 Treat files as mount point and report on any files open in the file system.
61 .It Fl f
62 The report must be only for named files.
63 .It Fl k
64 Send signal to reported processes
65 .Pq SIGKILL by default .
66 .It Fl m
67 Search through mmapped files too.
68 .It Fl u
69 Write the user name associated with each process to stderr.
70 .It Fl M
71 Extract values associated with the name list from the specified core
72 instead of the default
73 .Pa /dev/kmem .
74 .It Fl N
75 Extract the name list from the specified system instead of the default,
76 which is the kernel image the system has booted from.
77 .It Fl s
78 Use given signal name instead of default SIGKILL.
79 .El
80 .Pp
81 The following symbols, written to stderr will indicate how files is used:
82 .Bl -tag -width MOUNT
83 .It Cm r
84 The file is the root directory of the process.
85 .It Cm c
86 The file is the current workdir directory of the process.
87 .It Cm j
88 The file is the jail-root of the process.
89 .It Cm t
90 The file is the kernel tracing file for the process.
91 .It Cm x
92 The file is executable text of the process.
93 .It Cm y
94 The process use this file as its controlling tty.
95 .It Cm m
96 The file is mmapped.
97 .It Cm w
98 The file is open for writing.
99 .It Cm a
100 The file is open as append only
101 .Pq O_APPEND was specified .
102 .It Cm d
103 The process bypasses fs cache while writing to this file
104 .Pq O_DIRECT was specified .
105 .It Cm s
106 Shared lock is hold.
107 .It Cm e
108 Exclusive lock is hold.
109 .El
110 .Sh EXIT STATUS
111 The
112 .Nm
113 utility returns 0 on successful completion and >0 otherwise.
114 .Sh EXAMPLES
115 The command:
116 .Dq Li "fuser -fu ."
117 writes to standard output the process IDs of processes that are using the
118 current directory and writes to stderr an indication of how those processes are
119 using the directory and user names associated with the processes that are using
120 this directory.
121 .Sh SEE ALSO
122 .Xr fstat 1 ,
123 .Xr ps 1 ,
124 .Xr systat 1 ,
125 .Xr iostat 8 ,
126 .Xr pstat 8 ,
127 .Xr vmstat 8
128 .Sh STANDARDS
129 The
130 .Nm
131 utility is expected to conform to
132 .St -p1003.1-2004 .
133 .Sh HISTORY
134 The
135 .Nm
136 utility appeared in
137 .Fx 9.0 .
138 .Sh AUTHORS
139 The
140 .Nm
141 utility and this manual page was written by
142 .An Stanislav Sedov Aq stas@FreeBSD.org .
143 .Sh BUGS
144 Since
145 .Nm
146 takes a snapshot of the system, it is only correct for a very short period
147 of time.
148 When working via
149 .Xr kvm 3
150 interface the report will be limited to filesystems the
151 .Nm
152 utility knows about (currently only cd9660, devfs, nfs, ntfs, nwfs, udf,
153 ufs and zfs).