Annotation of src/usr.bin/fstat/fuser.1, Revision 1.1
1.1 ! millert 1: .\" $OpenBSD$
! 2: .\"
! 3: .\" Copyright (c) 2002 Peter Werner <peterw@ifost.org.au>
! 4: .\" All rights reserved.
! 5: .\"
! 6: .\" Redistribution and use in source and binary forms, with or without
! 7: .\" modification, are permitted provided that the following conditions
! 8: .\" are met:
! 9: .\"
! 10: .\" 1. Redistributions of source code must retain the above copyright
! 11: .\" notice, this list of conditions and the following disclaimer.
! 12: .\" 2. The name of the author may not be used to endorse or promote products
! 13: .\" derived from this software without specific prior written permission.
! 14: .\"
! 15: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
! 16: .\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
! 17: .\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
! 18: .\" THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
! 19: .\" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
! 20: .\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
! 21: .\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
! 22: .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
! 23: .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
! 24: .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
! 25: .\"
! 26: .Dd $Mdocdate$
! 27: .Dt FUSER 1
! 28: .Os
! 29: .Sh NAME
! 30: .Nm fuser
! 31: .Nd identify process IDs holding specific files open
! 32: .Sh SYNOPSIS
! 33: .Nm
! 34: .Op Fl cfku
! 35: .Op Fl M Ar core
! 36: .Op Fl N Ar system
! 37: .Op Fl s Ar signal
! 38: .Ar
! 39: .Sh DESCRIPTION
! 40: The
! 41: .Nm
! 42: utility writes to standard output the process IDs of processes running
! 43: on the local system that have one or more of the named files open.
! 44: If
! 45: .Ar file
! 46: is a mounted block device, the output will show all processes having
! 47: files opened on that file system.
! 48: .Pp
! 49: The options are as follows:
! 50: .Bl -tag -width Ds
! 51: .It Fl c
! 52: The file is treated as a mount point and
! 53: .Nm
! 54: will report on any files open in the file system.
! 55: .It Fl f
! 56: Report only for the named file(s).
! 57: .It Fl k
! 58: Send the SIGKILL signal to each process.
! 59: .It Fl M Ar core
! 60: Extract values associated with the name list from the specified core
! 61: instead of the running kernel.
! 62: .It Fl N Ar system
! 63: Extract the name list from the specified system instead of the running kernel.
! 64: .It Fl s Ar signal
! 65: Send the specified
! 66: .Ar signal
! 67: to each process.
! 68: The
! 69: .Ar signal
! 70: may be specified as a signal number or as a symbolic name either with
! 71: or without the
! 72: .Dq SIG
! 73: prefix.
! 74: Signal names are not case sensitive.
! 75: For example, the following signal arguments are equivalent:
! 76: .Dq 9 ,
! 77: .Dq kill ,
! 78: .Dq SIGKILL .
! 79: .It Fl u
! 80: The real user ID of the the process using the file will be printed in brackets
! 81: to standard error.
! 82: If the username is unable to be determined, the real user ID will be printed
! 83: instead.
! 84: .El
! 85: .Pp
! 86: The
! 87: .Fl c
! 88: and
! 89: .Fl f
! 90: options are mutually exclusive.
! 91: .Pp
! 92: The name of the file followed by a colon
! 93: .Pq Sq \&:
! 94: is printed to standard error.
! 95: The following characters may be printed to standard error after the process ID
! 96: if the described conditions are true:
! 97: .Pp
! 98: .Bl -tag -width Ds -offset indent -compact
! 99: .It c
! 100: The file is the process's current working directory.
! 101: .It r
! 102: The file is the process's root directory.
! 103: .El
! 104: .Pp
! 105: .Ex -std fuser
! 106: .Sh EXAMPLES
! 107: Print the process IDs of any processes holding files open under the
! 108: .Ar /mnt
! 109: filesystem:
! 110: .Pp
! 111: .Dl $ fuser -c /mnt
! 112: .Pp
! 113: Send SIGTERM to any process holding a file open under the
! 114: .Ar /mnt
! 115: filesystem:
! 116: .Pp
! 117: .Dl # fuser -c -s term /mnt
! 118: .Pp
! 119: Report on all files opened under the filesystem on which
! 120: .Ar /dev/wd0a
! 121: is mounted:
! 122: .Pp
! 123: .Dl $ fuser /dev/wd0a
! 124: .Pp
! 125: Report on all processes currently holding
! 126: .Ar /dev/wd0a
! 127: open:
! 128: .Pp
! 129: .Dl $ fuser -f /dev/wd0a
! 130: .Sh SEE ALSO
! 131: .Xr fstat 1 ,
! 132: .Xr kill 1 ,
! 133: .Xr signal 3 ,
! 134: .Xr mount 8
! 135: .Sh STANDARDS
! 136: The
! 137: .Nm
! 138: utility is compliant with the
! 139: .St -p1003.1-2008
! 140: specification.
! 141: .Pp
! 142: The flags
! 143: .Op Fl ks
! 144: are extensions to that specification.