📄 who.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>who</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_2885"> </a>NAME</h4><blockquote>who - display who is on the system</blockquote><h4><a name = "tag_001_014_2886"> </a>SYNOPSIS</h4><blockquote><pre><code>who <b>[</b>-mu<b>]</b>-s<b>[</b>-bHlprt<b>][</b><i>file</i><b>]</b>who <b>[</b>-mTu<b>][</b>-abdHlprt<b>][</b><i>file</i><b>]</b>who -q <b>[</b><i>file</i><b>]</b>who am iwho am I</code></pre></blockquote><h4><a name = "tag_001_014_2887"> </a>DESCRIPTION</h4><blockquote>The<i>who</i>utility lists various pieces of information about accessible users.The domain of accessibility is implementation-dependent.<p>Based on the options given,<i>who</i>also can list the user's name, terminal line, login time,elapsed time since activity occurred on the lineand the process ID of the command interpreterfor each current system user.</blockquote><h4><a name = "tag_001_014_2888"> </a>OPTIONS</h4><blockquote>The<i>who</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.The metavariables, such as<<i>line</i>>,refer to fields described in the STDOUT section.<dl compact><dt><b>-a</b><dd>Process the implementation-dependent database or named file with the<b>-b</b>,<b>-d</b>,<b>-l</b>,<b>-p</b>,<b>-r</b>,<b>-t</b>,<b>-T</b>and<b>-u</b>options turned on.<dt><b>-b</b><dd>Write the time and date of the last reboot.<dt><b>-d</b><dd>Write a list of all processesthat have expired and not been respawned by the<i>init</i>system process.The<<i>exit</i>>field appears for dead processes and contains the termination and exitvalues of the dead process.This can be useful in determining why a process terminated.<dt><b>-H</b><dd>Write column headings above the regular output.<dt><b>-l</b><dd>(The letter ell.)List only those lines on which the system is waitingfor someone to login.The<<i>name</i>>field is<b>LOGIN</b>in such cases.Other fields are the same as for user entries except that the<<i>state</i>>field does not exist.<dt><b>-m</b><dd>Output only informationabout the current terminal.<dt><b>-p</b><dd>List any other process that is currently active and hasbeen previously spawned by<i>init</i>.<dt><b>-q</b><dd>(Quick.)List only the names and the number of users currently logged on.When this option is used, all other options are ignored.<dt><b>-r</b><dd>Write the current<i>run-level</i>of the<i>init</i>process.<dt><b>-s</b><dd>List only the<<i>name</i>>,<<i>line</i>>and<<i>time</i>>fields.This is the default case.<dt><b>-t</b><dd>Indicate the last change to the system clock.<dt><b>-T</b><dd>Show the state of each terminal,as described in the STDOUT section.<dt><b>-u</b><dd>This option lists only those users who are currently logged in.Output the user's "idle time" inaddition to any other information.The idle time is the timesince any activity occurred on the user's terminal.The method of determining this is unspecified.The<<i>name</i>>is the user's login name.The<<i>line</i>>is the name of the line as found in the directory<b>/dev</b>.The<<i>time</i>>is the time that the user logged in.The<<i>activity</i>>is the number of hours and minutes since activity last occurred onthat particular line.A dotindicates that the terminal has seen activity in the last minuteand is therefore "current."If more than twenty-four hours have elapsed orthe line has not been used since boot time,the entry is marked<old>.This field is useful when trying to determinewhether a person is working at the terminal or not.The<<i>pid</i>>is the process ID of the user's login process.</dl></blockquote><h4><a name = "tag_001_014_2889"> </a>OPERANDS</h4><blockquote>The following operands are supported:<dl compact><dt><b>am i</b><dd><dt><b>am I</b><dd>In the POSIX locale, limit the outputto describing the invoking user, equivalent to the<b>-m</b>option.The<b>am</b>andiorImust be separate arguments.<dt><i>file</i><dd>Specify a pathname of a file to substitute forthe implementation-dependent database of logged-on users that<i>who</i>uses by default.</dl></blockquote><h4><a name = "tag_001_014_2890"> </a>STDIN</h4><blockquote>Not used.</blockquote><h4><a name = "tag_001_014_2891"> </a>INPUT FILES</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_2892"> </a>ENVIRONMENT VARIABLES</h4><blockquote>The following environment variables affect the execution of<i>who</i>:<dl compact><dt><i>LANG</i><dd>Provide a default value for the internationalisation variablesthat 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 internationalisation variables contains an invalid setting, theutility will behave as if none of the variables had been defined.<dt><i>LC_ALL</i><dd>If set to a non-empty string value,override the values of all the other internationalisation variables.<dt><i>LC_CTYPE</i><dd>Determine thelocale for the interpretation of sequences of bytes of text data ascharacters (for example, single- as opposed to multi-byte charactersin arguments).<dt><i>LC_MESSAGES</i><dd>Determine the locale that should be used to affectthe format and contents of diagnosticmessages written to standard error.<dt><i>LC_TIME</i><dd>Determine the locale used for the format and contentsof the date and time strings.<dt><i>NLSPATH</i><dd>Determine the location of message cataloguesfor the processing of<i>LC_MESSAGES .</i></dl></blockquote><h4><a name = "tag_001_014_2893"> </a>ASYNCHRONOUS EVENTS</h4><blockquote>Default.</blockquote><h4><a name = "tag_001_014_2894"> </a>STDOUT</h4><blockquote>The<i>who</i>utility writes its default information to the standard output inthe following general format:<pre><code><<i>name</i>><b>[</b><<i>state</i>><b>]</b><<i>line</i>><<i>time</i>><b>[</b><<i>activity</i>><b>][</b><<i>pid</i>><b>][</b><<i>comment</i>><b>][</b><<i>exit</i>><b>]</b></code></pre><p>The following format is used for the<b>-T</b>option:<p><code><pre><tt>"%s %c %s %s\n"</tt>, <<i>name</i>>,<<i>terminal state</i>>,<<i>terminal name</i>>,<<i>time of login</i>></pre></code>where<<i>terminal state</i>>is one of the following characters:<dl compact><dt><b>+</b><dd>The terminal allows write access to other users.<dt><b>-</b><dd>The terminal denies write access to other users.<dt><b>?</b><dd>The terminal write-access state cannot be determined.</dl><p>In the POSIX locale, the<<i>time of login</i>>is equivalent in format to the output of:<pre><code>date +"%b %e %H:%M"</code></pre><p>If the<b>-u</b>option is used with<b>-T</b>,the idle time is added to the end of the previous formatin an unspecified format.</blockquote><h4><a name = "tag_001_014_2895"> </a>STDERR</h4><blockquote>Used only for diagnostic messages.</blockquote><h4><a name = "tag_001_014_2896"> </a>OUTPUT FILES</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_2897"> </a>EXTENDED DESCRIPTION</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_2898"> </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_2899"> </a>CONSEQUENCES OF ERRORS</h4><blockquote>Default.</blockquote><h4><a name = "tag_001_014_2900"> </a>APPLICATION USAGE</h4><blockquote>The name<i>init</i>used for the system process is the most commonly usedon historical systems, but it may vary.<p>The "domain of accessibility" referred to is abroad concept that permits interpretation either on a very secure basisor even to allow a network-wideimplementation like the historical</blockquote><h4><a name = "tag_001_014_2901"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_2902"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_2903"> </a>SEE ALSO</h4><blockquote><i><a href="mesg.html">mesg</a></i>.<br></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 + -