📄 fuser.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>fuser</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_001_014_795"> </a>NAME</h4><blockquote>fuser - list process IDs of all processes that have one or morefiles open</blockquote><h4><a name = "tag_001_014_796"> </a>SYNOPSIS</h4><blockquote><pre><code>fuser <b>[</b> -cfu <b>]</b><i> file</i><b> ...</b></code></pre></blockquote><h4><a name = "tag_001_014_797"> </a>DESCRIPTION</h4><blockquote>The<i>fuser</i>utility writes to standard output the process IDs ofprocesses running on the local system that have one or morenamed files open.For block special devices, all processesusing any file on that device are listed.<p>The<i>fuser</i>utility writes to standard error additionalinformation about the named files indicating how the file isbeing used.<p>Any output for processes running on remote systems that have anamed file open is unspecified.<p>A user may need appropriate privilege to invoke the<i>fuser</i>utility.</blockquote><h4><a name = "tag_001_014_798"> </a>OPTIONS</h4><blockquote>The<i>fuser</i>utility supports the <b>XBD</b> specification, <a href="../xbd/utilconv.html#usg"><b>Utility Syntax Guidelines</b> </a> .<p>The following options are supported:<dl compact><dt><b>-c</b><dd>The file is treated as a mount point and the utility reportson any files open in the file system.<dt><b>-f</b><dd>The report is only for the named files.<dt><b>-u</b><dd>The user name, in parentheses, associated with each processID written to standard output is written to standard error.</dl></blockquote><h4><a name = "tag_001_014_799"> </a>OPERANDS</h4><blockquote><dl compact><dt><i>file</i><dd>A pathname on which the file or file system is to be reported.</dl></blockquote><h4><a name = "tag_001_014_800"> </a>STDIN</h4><blockquote>Not used.</blockquote><h4><a name = "tag_001_014_801"> </a>INPUT FILES</h4><blockquote>The user database.</blockquote><h4><a name = "tag_001_014_802"> </a>ENVIRONMENT VARIABLES</h4><blockquote>The following environment variables affect the execution of<i>fuser</i>:<dl compact><dt><i>LANG</i><dd>Provide a default value for the internationalizationvariables that are unset or null.If<i>LANG</i>is unset or null, the corresponding value from theimplementation-dependent default locale will be used.If any of the internationalization variables contain an invalid setting,the utility will behave as if none of the variables had been set.<dt><i>LC_ALL</i><dd>If set to a non-empty string value, override the values ofall the other internationalization variables.<dt><i>LC_CTYPE</i><dd>Determine the locale for the interpretation of sequences ofbytes of text data as characters (for example, single- asopposed to multi-byte characters in arguments).<dt><i>LC_MESSAGES</i><dd>Determine the locale that should be used to affectthe format and contents of diagnostic messages written tostandard error.<dt><i>NLSPATH</i><dd>Determine the location of message catalogues for theprocessing of<i>LC_MESSAGES .</i></dl></blockquote><h4><a name = "tag_001_014_803"> </a>ASYNCHRONOUS EVENTS</h4><blockquote>Default.</blockquote><h4><a name = "tag_001_014_804"> </a>STDOUT</h4><blockquote>The<i>fuser</i>utility will write the process ID for each processusing each file given as an operand to standard output in thefollowing format:<pre><code>"%d", <<i>process_id</i>></code></pre></blockquote><h4><a name = "tag_001_014_805"> </a>STDERR</h4><blockquote>The<i>fuser</i>utility writes diagnostic messages to standard error.<p>The<i>fuser</i>utility also writes the following to standard error:<ul><p><li>The pathname of each named file is written followedimmediately by a colon.<p><li>For each process ID written to standard output, thecharacter c is written to standard error if the processis using the file as its current directory and thecharacter r is written to standard error if the processis using the file as its root directory.Implementations may write other alphabetic characters to indicate otheruses of files.<p><li>When the<b>-u</b>option is specified, characters indicatingthe use of the file are followed immediately by the username, in parentheses, corresponding to the process'real user ID.If the user name cannot be resolved fromthe process' real user ID, the process' real user IDis written instead of the user name.<p></ul><p>When standard output and standard error are directed to thesame file, the output is interspersed so that the filenameappears at the start of each line, followed by the process IDand characters indicating the use of the file.Then, if the<b>-u</b>option is specified, the user name or user ID for eachprocess using that file is written.<p>A new line character is written to standard error after thelast output described above for each file operand.</blockquote><h4><a name = "tag_001_014_806"> </a>OUTPUT FILES</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_807"> </a>EXTENDED DESCRIPTION</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_808"> </a>EXIT STATUS</h4><blockquote>The following exit values are returned:<dl compact><dt> 0<dd>Successful completion.<dt>>0<dd>An error occurred.</dl></blockquote><h4><a name = "tag_001_014_809"> </a>CONSEQUENCES OF ERRORS</h4><blockquote>Default.</blockquote><h4><a name = "tag_001_014_810"> </a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_811"> </a>EXAMPLES</h4><blockquote>The command:<pre><code>fuser -fu .</code></pre><p>writes to standard output the process IDs of processes thatare using the current directory and writes to standard erroran indication of how those processes are using the directoryand the user names associated with the processes that areusing the current directory.</blockquote><h4><a name = "tag_001_014_812"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_813"> </a>SEE ALSO</h4><blockquote>None.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -