2011-05-14 04:02:56 +00:00
|
|
|
.\" Copyright (c) 2005-2011 Stanislav Sedov <stas@FreeBSD.org>
|
2011-05-12 10:11:39 +00:00
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
2020-06-18 11:18:26 +00:00
|
|
|
.Dd June 18, 2020
|
2011-05-12 10:11:39 +00:00
|
|
|
.Dt FUSER 1
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm fuser
|
2012-03-29 05:02:12 +00:00
|
|
|
.Nd list IDs of all processes that have one or more files open
|
2011-05-12 10:11:39 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
|
|
|
.Op Fl cfkmu
|
|
|
|
.Op Fl M Ar core
|
|
|
|
.Op Fl N Ar system
|
|
|
|
.Op Fl s Ar signal
|
2013-04-11 12:24:29 +00:00
|
|
|
.Ar
|
2011-05-12 10:11:39 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility writes to stdout the PIDs of processes that have one or
|
|
|
|
more named files open.
|
|
|
|
For block and character special devices, all processes using files
|
|
|
|
on that device are listed.
|
|
|
|
A file is considered open by a process if it was explicitly opened,
|
|
|
|
is the working directory, root directory, jail root directory,
|
|
|
|
active executable text, kernel trace file or the controlling terminal
|
|
|
|
of the process.
|
|
|
|
If
|
|
|
|
.Fl m
|
|
|
|
option is specified, the
|
|
|
|
.Nm
|
|
|
|
utility will also look through mmapped files.
|
|
|
|
.Pp
|
|
|
|
The following options are available:
|
|
|
|
.Bl -tag -width indent
|
|
|
|
.It Fl c
|
2020-06-18 11:18:26 +00:00
|
|
|
Treat files as mount points and report on any files open in the file system.
|
2011-05-12 10:11:39 +00:00
|
|
|
.It Fl f
|
|
|
|
The report must be only for named files.
|
|
|
|
.It Fl k
|
|
|
|
Send signal to reported processes
|
2020-06-18 11:18:26 +00:00
|
|
|
.Pq Dv SIGKILL No by default .
|
|
|
|
.It Fl M Ar core
|
2011-05-12 10:11:39 +00:00
|
|
|
Extract values associated with the name list from the specified core
|
|
|
|
instead of the default
|
|
|
|
.Pa /dev/kmem .
|
2020-06-18 11:18:26 +00:00
|
|
|
.It Fl m
|
|
|
|
Search through mmapped files too.
|
|
|
|
.It Fl N Ar system
|
2011-05-12 10:11:39 +00:00
|
|
|
Extract the name list from the specified system instead of the default,
|
|
|
|
which is the kernel image the system has booted from.
|
2020-06-18 11:18:26 +00:00
|
|
|
.It Fl s Ar signal
|
|
|
|
Use given signal name instead of default
|
|
|
|
.Dv SIGKILL .
|
|
|
|
.It Fl u
|
|
|
|
Write the user name associated with each process to stderr.
|
2011-05-12 10:11:39 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
2020-06-18 11:18:26 +00:00
|
|
|
The following symbols, written to stderr will indicate how files are used:
|
|
|
|
.Pp
|
|
|
|
.Bl -tag -width indent -compact
|
|
|
|
.It Sy a
|
2011-05-12 10:11:39 +00:00
|
|
|
The file is open as append only
|
2020-06-18 11:18:26 +00:00
|
|
|
.Pq Dv O_APPEND No was specified .
|
|
|
|
.It Sy c
|
|
|
|
The file is the current workdir directory of the process.
|
|
|
|
.It Sy d
|
2011-05-12 10:11:39 +00:00
|
|
|
The process bypasses fs cache while writing to this file
|
2020-06-18 11:18:26 +00:00
|
|
|
.Pq Dv O_DIRECT No was specified .
|
|
|
|
.It Sy e
|
2011-05-12 10:11:39 +00:00
|
|
|
Exclusive lock is hold.
|
2020-06-18 11:18:26 +00:00
|
|
|
.It Sy j
|
|
|
|
The file is the jail root of the process.
|
|
|
|
.It Sy m
|
|
|
|
The file is mmapped.
|
|
|
|
.It Sy r
|
|
|
|
The file is the root directory of the process.
|
|
|
|
.It Sy s
|
|
|
|
Shared lock is hold.
|
|
|
|
.It Sy t
|
|
|
|
The file is the kernel tracing file for the process.
|
|
|
|
.It Sy w
|
|
|
|
The file is open for writing.
|
|
|
|
.It Sy x
|
|
|
|
The file is executable text of the process.
|
|
|
|
.It Sy y
|
|
|
|
The process uses this file as its controlling tty.
|
2011-05-12 10:11:39 +00:00
|
|
|
.El
|
|
|
|
.Sh EXIT STATUS
|
2020-06-18 11:18:26 +00:00
|
|
|
.Ex -std
|
2011-05-12 10:11:39 +00:00
|
|
|
.Sh EXAMPLES
|
2020-06-18 11:18:26 +00:00
|
|
|
The command
|
|
|
|
.Ql "fuser -fu \&."
|
2011-05-14 04:02:56 +00:00
|
|
|
writes to standard output the process IDs of processes that are using the
|
2011-05-12 10:11:39 +00:00
|
|
|
current directory and writes to stderr an indication of how those processes are
|
2011-05-14 04:02:56 +00:00
|
|
|
using the directory and user names associated with the processes that are using
|
2011-05-12 10:11:39 +00:00
|
|
|
this directory.
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr fstat 1 ,
|
|
|
|
.Xr ps 1 ,
|
|
|
|
.Xr systat 1 ,
|
|
|
|
.Xr iostat 8 ,
|
|
|
|
.Xr pstat 8 ,
|
|
|
|
.Xr vmstat 8
|
2011-05-14 04:02:56 +00:00
|
|
|
.Sh STANDARDS
|
2011-05-12 10:11:39 +00:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility is expected to conform to
|
|
|
|
.St -p1003.1-2004 .
|
2011-06-02 09:56:53 +00:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility appeared in
|
|
|
|
.Fx 9.0 .
|
|
|
|
.Sh AUTHORS
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility and this manual page was written by
|
2014-06-23 08:23:05 +00:00
|
|
|
.An Stanislav Sedov Aq Mt stas@FreeBSD.org .
|
2011-05-12 10:11:39 +00:00
|
|
|
.Sh BUGS
|
|
|
|
Since
|
|
|
|
.Nm
|
|
|
|
takes a snapshot of the system, it is only correct for a very short period
|
|
|
|
of time.
|
|
|
|
When working via
|
|
|
|
.Xr kvm 3
|
|
|
|
interface the report will be limited to filesystems the
|
|
|
|
.Nm
|
|
|
|
utility knows about (currently only cd9660, devfs, nfs, ntfs, nwfs, udf,
|
|
|
|
ufs and zfs).
|