isposix

Un outil pour savoir si une commande est posix - retour accueil

git clone git://bebou.netlib.re/isposix
Log | Files | Refs | README |

who.html (19056B)


      1 <!-- Copyright 2001-2024 IEEE and The Open Group, All Rights Reserved -->
      2 <!DOCTYPE HTML>
      3 <html lang="en">
      4 <head>
      5 <meta name="generator" content="HTML Tidy for HTML5 for Linux version 5.8.0">
      6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      7 <link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group rhtm tool v1.2.4 -->
      8 <!-- Copyright (c) 2001-2024 The Open Group, All Rights Reserved -->
      9 <title>who</title>
     10 </head>
     11 <body bgcolor="white">
     12 <div class="NAVHEADER">
     13 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0">
     14 <tr class="nav">
     15 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/what.html" accesskey="P">&lt;&lt;&lt;
     16 Previous</a></td>
     17 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td>
     18 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/write.html" accesskey="N">Next
     19 &gt;&gt;&gt;</a></td>
     20 </tr>
     21 </table>
     22 <hr align="left" width="100%"></div>
     23 <script language="JavaScript" src="../jscript/codes.js"></script><basefont size="3">
     24 <center><font size="2">The Open Group Base Specifications Issue 8<br>
     25 IEEE Std 1003.1-2024<br>
     26 Copyright © 2001-2024 The IEEE and The Open Group</font></center>
     27 <hr size="2" noshade>
     28 <a name="top" id="top"></a> <a name="who" id="who"></a> <a name="tag_20_150" id="tag_20_150"></a><!-- who -->
     29 <h4 class="mansect"><a name="tag_20_150_01" id="tag_20_150_01"></a>NAME</h4>
     30 <blockquote>who — display who is on the system</blockquote>
     31 <h4 class="mansect"><a name="tag_20_150_02" id="tag_20_150_02"></a>SYNOPSIS</h4>
     32 <blockquote class="synopsis">
     33 <p><code><tt><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> who</tt> <b>[</b><tt>-mTu</tt><b>] <img src=
     34 "../images/opt-start.gif" border="0">[</b><tt>-abdHlprt</tt><b>] [</b><i>file</i><b>]</b><tt><img src="../images/opt-end.gif"
     35 border="0"><br>
     36 <br></tt></code></p>
     37 <div class="box"><code><tt><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt=
     38 "[Option Start]" border="0"> who</tt> <b>[</b><tt>-mu</tt><b>]</b> <tt>-s</tt> <b>[</b><tt>-bHlprt</tt><b>]
     39 [</b><i>file</i><b>]</b> <tt><br>
     40 <br>
     41 who -q</tt> <b>[</b><i>file</i><b>]</b> <tt><br>
     42 <br>
     43 who am i<br>
     44 <br>
     45 who am I <img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></code></div>
     46 <tt><br></tt></blockquote>
     47 <h4 class="mansect"><a name="tag_20_150_03" id="tag_20_150_03"></a>DESCRIPTION</h4>
     48 <blockquote>
     49 <p>The <i>who</i> utility shall list various pieces of information about accessible users. The domain of accessibility is
     50 implementation-defined.</p>
     51 <p><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
     52 Based on the options given, <i>who</i> can also list the user's name, terminal line, login time, elapsed time since activity
     53 occurred on the line, and the process ID of the command interpreter for each current system user. <img src="../images/opt-end.gif"
     54 alt="[Option End]" border="0"></p>
     55 </blockquote>
     56 <h4 class="mansect"><a name="tag_20_150_04" id="tag_20_150_04"></a>OPTIONS</h4>
     57 <blockquote>
     58 <p>The <i>who</i> utility shall conform to XBD <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax
     59 Guidelines</i></a> .</p>
     60 <p>The following options shall be supported. The metavariables, such as &lt;<i>line</i>&gt;, refer to fields described in the
     61 STDOUT section.</p>
     62 <dl compact>
     63 <dd></dd>
     64 <dt><b>-a</b></dt>
     65 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
     66 Process the implementation-defined database or named file with the <b>-b</b>, <b>-d</b>, <b>-l</b>, <b>-p</b>, <b>-r</b>,
     67 <b>-t</b>, <b>-T</b> and <b>-u</b> options turned on. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
     68 <dt><b>-b</b></dt>
     69 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
     70 Write the time and date of the last system reboot. The system reboot time is the time at which the implementation is able to
     71 commence running processes. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
     72 <dt><b>-d</b></dt>
     73 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
     74 Write a list of all processes that have expired and not been respawned by the <i>init</i> system process. The &lt;<i>exit</i>&gt;
     75 field shall appear for dead processes and contain the termination and exit values of the dead process. This can be useful in
     76 determining why a process terminated. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
     77 <dt><b>-H</b></dt>
     78 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
     79 Write column headings above the regular output. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
     80 <dt><b>-l</b></dt>
     81 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
     82 (The letter ell.) List only those lines on which the system is waiting for someone to login. The &lt;<i>name</i>&gt; field shall be
     83 <b>LOGIN</b> in such cases. Other fields shall be the same as for user entries except that the &lt;<i>state</i>&gt; field does not
     84 exist. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
     85 <dt><b>-m</b></dt>
     86 <dd>Output only information about the current terminal.</dd>
     87 <dt><b>-p</b></dt>
     88 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
     89 List any other process that is currently active and has been previously spawned by <i>init</i>. <img src="../images/opt-end.gif"
     90 alt="[Option End]" border="0"></dd>
     91 <dt><b>-q</b></dt>
     92 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
     93 (Quick.) List only the names and the number of users currently logged on. When this option is used, all other options shall be
     94 ignored. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
     95 <dt><b>-r</b></dt>
     96 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
     97 Write the current <i>run-level</i> of the <i>init</i> process. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
     98 <dt><b>-s</b></dt>
     99 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
    100 List only the &lt;<i>name</i>&gt;, &lt;<i>line</i>&gt;, and &lt;<i>time</i>&gt; fields. This is the default case. <img src=
    101 "../images/opt-end.gif" alt="[Option End]" border="0"></dd>
    102 <dt><b>-t</b></dt>
    103 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
    104 Indicate the last change to the system clock. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
    105 <dt><b>-T</b></dt>
    106 <dd>Show the state of each terminal, as described in the STDOUT section.</dd>
    107 <dt><b>-u</b></dt>
    108 <dd>Write &quot;idle time&quot; for each displayed user in addition to any other information. The idle time is the time since any activity
    109 occurred on the user's terminal. The method of determining this is unspecified. <sup>[<a href=
    110 "javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> &nbsp;This option
    111 shall list only those users who are currently logged in. The &lt;<i>name</i>&gt; is the user's login name. The &lt;<i>line</i>&gt;
    112 is the name of the line as found in the directory <b>/dev</b>. The &lt;<i>time</i>&gt; is the time that the user logged in. The
    113 &lt;<i>activity</i>&gt; is the number of hours and minutes since activity last occurred on that particular line. A dot indicates
    114 that the terminal has seen activity in the last minute and is therefore &quot;current&quot;. If more than twenty-four hours have elapsed or
    115 the line has not been used since boot time, the entry shall be marked &lt;<i>old</i>&gt;. This field is useful when trying to
    116 determine whether a person is working at the terminal or not. The &lt;<i>pid</i>&gt; is the process ID of the user's login process.
    117 <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
    118 </dl>
    119 </blockquote>
    120 <h4 class="mansect"><a name="tag_20_150_05" id="tag_20_150_05"></a>OPERANDS</h4>
    121 <blockquote>
    122 <p><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
    123 The following operands shall be supported:</p>
    124 <dl compact>
    125 <dd></dd>
    126 <dt><b>am&nbsp;i</b>,&nbsp;<b>am&nbsp;I</b></dt>
    127 <dd>In the POSIX locale, limit the output to describing the invoking user, equivalent to the <b>-m</b> option. The <b>am</b> and
    128 <b>i</b> or <b>I</b> need to be separate arguments.</dd>
    129 <dt><i>file</i></dt>
    130 <dd>Specify a pathname of a file to substitute for the implementation-defined database of logged-on users that <i>who</i> uses by
    131 default. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
    132 </dl>
    133 </blockquote>
    134 <h4 class="mansect"><a name="tag_20_150_06" id="tag_20_150_06"></a>STDIN</h4>
    135 <blockquote>
    136 <p>Not used.</p>
    137 </blockquote>
    138 <h4 class="mansect"><a name="tag_20_150_07" id="tag_20_150_07"></a>INPUT FILES</h4>
    139 <blockquote>
    140 <p>None.</p>
    141 </blockquote>
    142 <h4 class="mansect"><a name="tag_20_150_08" id="tag_20_150_08"></a>ENVIRONMENT VARIABLES</h4>
    143 <blockquote>
    144 <p>The following environment variables shall affect the execution of <i>who</i>:</p>
    145 <dl compact>
    146 <dd></dd>
    147 <dt><i>LANG</i></dt>
    148 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href=
    149 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization
    150 variables used to determine the values of locale categories.)</dd>
    151 <dt><i>LC_ALL</i></dt>
    152 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd>
    153 <dt><i>LC_CTYPE</i></dt>
    154 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as
    155 opposed to multi-byte characters in arguments).</dd>
    156 <dt><i>LC_MESSAGES</i></dt>
    157 <dd><br>
    158 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.</dd>
    159 <dt><i>LC_TIME</i></dt>
    160 <dd>Determine the locale used for the format and contents of the date and time strings.</dd>
    161 <dt><i>NLSPATH</i></dt>
    162 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
    163 Determine the location of messages objects and message catalogs. <img src="../images/opt-end.gif" alt="[Option End]" border=
    164 "0"></dd>
    165 <dt><i>TZ</i></dt>
    166 <dd>Determine the timezone used when writing date and time information. If <i>TZ</i> is unset or null, an unspecified default
    167 timezone shall be used.</dd>
    168 </dl>
    169 </blockquote>
    170 <h4 class="mansect"><a name="tag_20_150_09" id="tag_20_150_09"></a>ASYNCHRONOUS EVENTS</h4>
    171 <blockquote>
    172 <p>Default.</p>
    173 </blockquote>
    174 <h4 class="mansect"><a name="tag_20_150_10" id="tag_20_150_10"></a>STDOUT</h4>
    175 <blockquote>
    176 <p>The <i>who</i> utility shall write its default format to the standard output in an implementation-defined format, subject only
    177 to the requirement of containing the information described above.</p>
    178 <p><sup>[<a href="javascript:open_code('XSI%20OF')">XSI OF</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]"
    179 border="0"> XSI-conformant systems shall write the default information to the standard output in the following general format:</p>
    180 <pre>
    181 <tt>&lt;</tt><i>name</i><tt>&gt;</tt><b>[</b><tt>&lt;</tt><i>state</i><tt>&gt;</tt><b>]</b><tt>&lt;</tt><i>line</i><tt>&gt;&lt;</tt><i>time</i><tt>&gt;</tt><b>[</b><tt>&lt;</tt><i>activity</i><tt>&gt;</tt><b>][</b><tt>&lt;</tt><i>pid</i><tt>&gt;</tt><b>][</b><tt>&lt;</tt><i>comment</i><tt>&gt;</tt><b>][</b><tt>&lt;</tt><i>exit</i><tt>&gt;</tt><b>]</b><tt>
    182 </tt></pre>
    183 <p>For the <b>-b</b> option, &lt;<i>line</i>&gt; shall be <tt>"system boot"</tt>. The &lt;<i>name</i>&gt; is unspecified. <img src=
    184 "../images/opt-end.gif" alt="[Option End]" border="0"></p>
    185 <p>The following format shall be used for the <b>-T</b> option:</p>
    186 <pre>
    187 <tt>"%s %c %s %s\n" &lt;</tt><i>name</i><tt>&gt;, &lt;</tt><i>terminal state</i><tt>&gt;, &lt;</tt><i>terminal name</i><tt>&gt;,
    188     &lt;</tt><i>time of login</i><tt>&gt;
    189 </tt></pre>
    190 <p>where &lt;<i>terminal&nbsp;state</i>&gt; is one of the following characters:</p>
    191 <dl compact>
    192 <dd></dd>
    193 <dt><tt>+</tt></dt>
    194 <dd>The terminal allows write access to other users.</dd>
    195 <dt><tt>-</tt></dt>
    196 <dd>The terminal denies write access to other users.</dd>
    197 <dt><tt>?</tt></dt>
    198 <dd>The terminal write-access state cannot be determined.</dd>
    199 <dt><tt>&lt;space&gt;</tt></dt>
    200 <dd>This entry is not associated with a terminal.</dd>
    201 </dl>
    202 <p>In the POSIX locale, the &lt;<i>time&nbsp;of&nbsp;login</i>&gt; shall be equivalent in format to the output of:</p>
    203 <pre>
    204 <tt>date +"%b %e %H:%M"
    205 </tt></pre>
    206 <p>If the <b>-u</b> option is used with <b>-T</b>, the idle time shall be added to the end of the previous format in an unspecified
    207 format.</p>
    208 </blockquote>
    209 <h4 class="mansect"><a name="tag_20_150_11" id="tag_20_150_11"></a>STDERR</h4>
    210 <blockquote>
    211 <p>The standard error shall be used only for diagnostic messages.</p>
    212 </blockquote>
    213 <h4 class="mansect"><a name="tag_20_150_12" id="tag_20_150_12"></a>OUTPUT FILES</h4>
    214 <blockquote>
    215 <p>None.</p>
    216 </blockquote>
    217 <h4 class="mansect"><a name="tag_20_150_13" id="tag_20_150_13"></a>EXTENDED DESCRIPTION</h4>
    218 <blockquote>
    219 <p>None.</p>
    220 </blockquote>
    221 <h4 class="mansect"><a name="tag_20_150_14" id="tag_20_150_14"></a>EXIT STATUS</h4>
    222 <blockquote>
    223 <p>The following exit values shall be returned:</p>
    224 <dl compact>
    225 <dd></dd>
    226 <dt>&nbsp;0</dt>
    227 <dd>Successful completion.</dd>
    228 <dt>&gt;0</dt>
    229 <dd>An error occurred.</dd>
    230 </dl>
    231 </blockquote>
    232 <h4 class="mansect"><a name="tag_20_150_15" id="tag_20_150_15"></a>CONSEQUENCES OF ERRORS</h4>
    233 <blockquote>
    234 <p>Default.</p>
    235 </blockquote>
    236 <hr>
    237 <div class="box"><em>The following sections are informative.</em></div>
    238 <h4 class="mansect"><a name="tag_20_150_16" id="tag_20_150_16"></a>APPLICATION USAGE</h4>
    239 <blockquote>
    240 <p>The name <i>init</i> used for the system process is the most commonly used on historical systems, but it may vary.</p>
    241 <p>The &quot;domain of accessibility&quot; referred to is a broad concept that permits interpretation either on a very secure basis or even
    242 to allow a network-wide implementation like the historical <i>rwho</i>.</p>
    243 </blockquote>
    244 <h4 class="mansect"><a name="tag_20_150_17" id="tag_20_150_17"></a>EXAMPLES</h4>
    245 <blockquote>
    246 <p>None.</p>
    247 </blockquote>
    248 <h4 class="mansect"><a name="tag_20_150_18" id="tag_20_150_18"></a>RATIONALE</h4>
    249 <blockquote>
    250 <p>Due to differences between historical implementations, the base options provided were a compromise to allow users to work with
    251 those functions. The standard developers also considered removing all the options, but felt that these options offered users
    252 valuable functionality. Additional options to match historical systems are available on XSI-conformant systems.</p>
    253 <p>It is recognized that the <i>who</i> command may be of limited usefulness, especially in a multi-level secure environment. The
    254 standard developers considered, however, that having some standard method of determining the &quot;accessibility&quot; of other users would
    255 aid user portability.</p>
    256 <p>No format was specified for the default <i>who</i> output for systems not supporting the XSI option. In such a user-oriented
    257 command, designed only for human use, this was not considered to be a deficiency.</p>
    258 <p>The format of the terminal name is unspecified, but the descriptions of <a href="../utilities/ps.html"><i>ps</i></a>, <a href=
    259 "../utilities/talk.html"><i>talk</i></a>, and <a href="../utilities/write.html"><i>write</i></a> require that they use the same
    260 format.</p>
    261 <p>It is acceptable for an implementation to produce no output for an invocation of <i>who</i> <b>mil</b>.</p>
    262 </blockquote>
    263 <h4 class="mansect"><a name="tag_20_150_19" id="tag_20_150_19"></a>FUTURE DIRECTIONS</h4>
    264 <blockquote>
    265 <p>None.</p>
    266 </blockquote>
    267 <h4 class="mansect"><a name="tag_20_150_20" id="tag_20_150_20"></a>SEE ALSO</h4>
    268 <blockquote>
    269 <p><a href="../utilities/mesg.html#"><i>mesg</i></a></p>
    270 <p>XBD <a href="../basedefs/V1_chap08.html#tag_08"><i>8. Environment Variables</i></a> , <a href=
    271 "../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax Guidelines</i></a></p>
    272 </blockquote>
    273 <h4 class="mansect"><a name="tag_20_150_21" id="tag_20_150_21"></a>CHANGE HISTORY</h4>
    274 <blockquote>
    275 <p>First released in Issue 2.</p>
    276 </blockquote>
    277 <h4 class="mansect"><a name="tag_20_150_22" id="tag_20_150_22"></a>Issue 6</h4>
    278 <blockquote>
    279 <p>This utility is marked as part of the User Portability Utilities option.</p>
    280 <p>The <i>TZ</i> entry is added to the ENVIRONMENT VARIABLES section.</p>
    281 </blockquote>
    282 <h4 class="mansect"><a name="tag_20_150_23" id="tag_20_150_23"></a>Issue 7</h4>
    283 <blockquote>
    284 <p>SD5-XCU-ERN-58 is applied, clarifying the <b>-b</b> option.</p>
    285 <p>The <i>who</i> utility is moved from the User Portability Utilities option to the Base. User Portability Utilities is now an
    286 option for interactive utilities.</p>
    287 <p>SD5-XCU-ERN-97 is applied, updating the SYNOPSIS.</p>
    288 </blockquote>
    289 <h4 class="mansect"><a name="tag_20_150_24" id="tag_20_150_24"></a>Issue 8</h4>
    290 <blockquote>
    291 <p>Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p>
    292 </blockquote>
    293 <div class="box"><em>End of informative text.</em></div>
    294 <hr>
    295 <p>&nbsp;</p>
    296 <a href="#top"><span class="topOfPage">return to top of page</span></a><br>
    297 <hr size="2" noshade>
    298 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br>
    299 POSIX™ is a Trademark of The IEEE.<br>
    300 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br>
    301 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
    302 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a>
    303 ]</font></center>
    304 <hr size="2" noshade>
    305 <div class="NAVHEADER">
    306 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0">
    307 <tr class="nav">
    308 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/what.html" accesskey="P">&lt;&lt;&lt;
    309 Previous</a></td>
    310 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td>
    311 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/write.html" accesskey="N">Next
    312 &gt;&gt;&gt;</a></td>
    313 </tr>
    314 </table>
    315 <hr align="left" width="100%"></div>
    316 </body>
    317 </html>