[BACK]Return to fuser.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / fstat

Annotation of src/usr.bin/fstat/fuser.1, Revision 1.4

1.4     ! jmc         1: .\"    $OpenBSD: fuser.1,v 1.3 2010/02/14 22:56:12 jmc Exp $
1.1       millert     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: .\"
1.4     ! jmc        26: .Dd $Mdocdate: February 14 2010 $
1.1       millert    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
1.3       jmc        80: The real user ID of the process using the file will be printed in brackets
1.1       millert    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.
1.2       millert   103: .It t
                    104: The file is the process's executable text.
1.1       millert   105: .El
1.4     ! jmc       106: .Sh EXIT STATUS
1.1       millert   107: .Ex -std fuser
                    108: .Sh EXAMPLES
                    109: Print the process IDs of any processes holding files open under the
                    110: .Ar /mnt
                    111: filesystem:
                    112: .Pp
                    113: .Dl $ fuser -c /mnt
                    114: .Pp
                    115: Send SIGTERM to any process holding a file open under the
                    116: .Ar /mnt
                    117: filesystem:
                    118: .Pp
                    119: .Dl # fuser -c -s term /mnt
                    120: .Pp
                    121: Report on all files opened under the filesystem on which
                    122: .Ar /dev/wd0a
                    123: is mounted:
                    124: .Pp
                    125: .Dl $ fuser /dev/wd0a
                    126: .Pp
                    127: Report on all processes currently holding
                    128: .Ar /dev/wd0a
                    129: open:
                    130: .Pp
                    131: .Dl $ fuser -f /dev/wd0a
                    132: .Sh SEE ALSO
                    133: .Xr fstat 1 ,
                    134: .Xr kill 1 ,
                    135: .Xr signal 3 ,
                    136: .Xr mount 8
                    137: .Sh STANDARDS
                    138: The
                    139: .Nm
                    140: utility is compliant with the
                    141: .St -p1003.1-2008
                    142: specification.
                    143: .Pp
                    144: The flags
                    145: .Op Fl ks
                    146: are extensions to that specification.