403 lines
16 KiB
HTML
403 lines
16 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<meta name="generator" content="HTML Tidy, see www.w3.org">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 -->
|
|
<!-- Copyright (c) 2001 The Open Group, All Rights Reserved -->
|
|
<title>who</title>
|
|
</head>
|
|
<body bgcolor="white">
|
|
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
|
|
</script>
|
|
|
|
<basefont size="3"> <a name="who"></a> <a name="tag_04_171"></a><!-- who -->
|
|
<!--header start-->
|
|
<center><font size="2">The Open Group Base Specifications Issue 6<br>
|
|
IEEE Std 1003.1-2001<br>
|
|
Copyright © 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
|
|
|
|
<!--header end-->
|
|
<hr size="2" noshade>
|
|
<h4><a name="tag_04_171_01"></a>NAME</h4>
|
|
|
|
<blockquote>who - display who is on the system</blockquote>
|
|
|
|
<h4><a name="tag_04_171_02"></a>SYNOPSIS</h4>
|
|
|
|
<blockquote class="synopsis">
|
|
<div class="box"><code><tt><sup>[<a href="javascript:open_code('UP')">UP</a>]</sup> <img src="../images/opt-start.gif" alt=
|
|
"[Option Start]" border="0"> who</tt> <b>[</b><tt>-mTu</tt><b>]</b><tt><img src="../images/opt-end.gif" border="0"><br>
|
|
<br>
|
|
</tt>
|
|
<div class="box"><code><tt><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt=
|
|
"[Option Start]" border="0"> who</tt>
|
|
<b>[</b><tt>-mu</tt><b>]</b><tt>-s</tt><b>[</b><tt>-bHlprt</tt><b>][</b><i>file</i><b>]</b><tt><br>
|
|
<br>
|
|
who</tt> <b>[</b><tt>-mTu</tt><b>][</b><tt>-abdHlprt</tt><b>][</b><i>file</i><b>]</b><tt><br>
|
|
<br>
|
|
who -q</tt> <b>[</b><i>file</i><b>]</b><tt><br>
|
|
<br>
|
|
who am i<br>
|
|
<br>
|
|
who am I <img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></code></div>
|
|
|
|
<tt><br>
|
|
</tt></code></div>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_171_03"></a>DESCRIPTION</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>who</i> utility shall list various pieces of information about accessible users. The domain of accessibility is
|
|
implementation-defined.</p>
|
|
|
|
<p><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
Based on the options given, <i>who</i> can also list the user's name, terminal line, login time, elapsed time since activity
|
|
occurred on the line, and the process ID of the command interpreter for each current system user. <img src="../images/opt-end.gif"
|
|
alt="[Option End]" border="0"></p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_171_04"></a>OPTIONS</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>who</i> utility shall conform to the Base Definitions volume of IEEE Std 1003.1-2001, <a href=
|
|
"../basedefs/xbd_chap12.html#tag_12_02">Section 12.2, Utility Syntax Guidelines</a>.</p>
|
|
|
|
<p>The following options shall be supported. The metavariables, such as <<i>line</i>>, refer to fields described in the
|
|
STDOUT section.</p>
|
|
|
|
<dl compact>
|
|
<dt><b>-a</b></dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
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>,
|
|
<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>
|
|
|
|
<dt><b>-b</b></dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
Write the time and date of the last reboot. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
|
|
|
|
<dt><b>-d</b></dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
Write a list of all processes that have expired and not been respawned by the <i>init</i> system process. The <<i>exit</i>>
|
|
field shall appear for dead processes and contain the termination and exit values of the dead process. This can be useful in
|
|
determining why a process terminated. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
|
|
|
|
<dt><b>-H</b></dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
Write column headings above the regular output. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
|
|
|
|
<dt><b>-l</b></dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
(The letter ell.) List only those lines on which the system is waiting for someone to login. The <<i>name</i>> field shall be
|
|
<b>LOGIN</b> in such cases. Other fields shall be the same as for user entries except that the <<i>state</i>> field does not
|
|
exist. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
|
|
|
|
<dt><b>-m</b></dt>
|
|
|
|
<dd>Output only information about the current terminal.</dd>
|
|
|
|
<dt><b>-p</b></dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
List any other process that is currently active and has been previously spawned by <i>init</i>. <img src="../images/opt-end.gif"
|
|
alt="[Option End]" border="0"></dd>
|
|
|
|
<dt><b>-q</b></dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
(Quick.) List only the names and the number of users currently logged on. When this option is used, all other options shall be
|
|
ignored. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
|
|
|
|
<dt><b>-r</b></dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
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>
|
|
|
|
<dt><b>-s</b></dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
List only the <<i>name</i>>, <<i>line</i>>, and <<i>time</i>> fields. This is the default case. <img src=
|
|
"../images/opt-end.gif" alt="[Option End]" border="0"></dd>
|
|
|
|
<dt><b>-t</b></dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
Indicate the last change to the system clock. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
|
|
|
|
<dt><b>-T</b></dt>
|
|
|
|
<dd>Show the state of each terminal, as described in the STDOUT section.</dd>
|
|
|
|
<dt><b>-u</b></dt>
|
|
|
|
<dd>Write "idle time" for each displayed user in addition to any other information. The idle time is the time since any activity
|
|
occurred on the user's terminal. The method of determining this is unspecified. <sup>[<a href=
|
|
"javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> This option
|
|
shall list only those users who are currently logged in. 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 on that particular line. A dot indicates
|
|
that the terminal has seen activity in the last minute and is therefore "current". If more than twenty-four hours have elapsed or
|
|
the line has not been used since boot time, the entry shall be marked <<i>old</i>>. This field is useful when trying to
|
|
determine whether a person is working at the terminal or not. The <<i>pid</i>> is the process ID of the user's login process.
|
|
<img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
|
|
</dl>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_171_05"></a>OPERANDS</h4>
|
|
|
|
<blockquote>
|
|
<p><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
The following operands shall be supported:</p>
|
|
|
|
<dl compact>
|
|
<dt><b>am i</b>, <b>am I</b></dt>
|
|
|
|
<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
|
|
<b>i</b> or <b>I</b> must be separate arguments.</dd>
|
|
|
|
<dt><i>file</i></dt>
|
|
|
|
<dd>Specify a pathname of a file to substitute for the implementation-defined database of logged-on users that <i>who</i> uses by
|
|
default. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
|
|
</dl>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_171_06"></a>STDIN</h4>
|
|
|
|
<blockquote>
|
|
<p>Not used.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_171_07"></a>INPUT FILES</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_171_08"></a>ENVIRONMENT VARIABLES</h4>
|
|
|
|
<blockquote>
|
|
<p>The following environment variables shall affect the execution of <i>who</i>:</p>
|
|
|
|
<dl compact>
|
|
<dt><i>LANG</i></dt>
|
|
|
|
<dd>Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of
|
|
IEEE Std 1003.1-2001, <a href="../basedefs/xbd_chap08.html#tag_08_02">Section 8.2, Internationalization Variables</a> for
|
|
the precedence of internationalization variables used to determine the values of locale categories.)</dd>
|
|
|
|
<dt><i>LC_ALL</i></dt>
|
|
|
|
<dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd>
|
|
|
|
<dt><i>LC_CTYPE</i></dt>
|
|
|
|
<dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as
|
|
opposed to multi-byte characters in arguments).</dd>
|
|
|
|
<dt><i>LC_MESSAGES</i></dt>
|
|
|
|
<dd>Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard
|
|
error.</dd>
|
|
|
|
<dt><i>LC_TIME</i></dt>
|
|
|
|
<dd>Determine the locale used for the format and contents of the date and time strings.</dd>
|
|
|
|
<dt><i>NLSPATH</i></dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
Determine the location of message catalogs for the processing of <i>LC_MESSAGES .</i> <img src="../images/opt-end.gif" alt=
|
|
"[Option End]" border="0"></dd>
|
|
|
|
<dt><i>TZ</i></dt>
|
|
|
|
<dd>Determine the timezone used when writing date and time information. If <i>TZ</i> is unset or null, an unspecified default
|
|
timezone shall be used.</dd>
|
|
</dl>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_171_09"></a>ASYNCHRONOUS EVENTS</h4>
|
|
|
|
<blockquote>
|
|
<p>Default.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_171_10"></a>STDOUT</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>who</i> utility shall write its default format to the standard output in an implementation-defined format, subject only
|
|
to the requirement of containing the information described above.</p>
|
|
|
|
<p><sup>[<a href="javascript:open_code('XSI OF')">XSI OF</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border=
|
|
"0"> XSI-conformant systems shall write the default information to the standard output in the following general format:</p>
|
|
|
|
<pre>
|
|
<tt><</tt><i>name</i><tt>></tt><b>[</b><tt><</tt><i>state</i><tt>></tt><b>]</b><tt><</tt><i>line</i><tt>><</tt><i>time</i><tt>></tt><b>[</b><tt><</tt><i>activity</i><tt>></tt><b>][</b><tt><</tt><i>pid</i><tt>></tt><b>][</b><tt><</tt><i>comment</i><tt>></tt><b>][</b><tt><</tt><i>exit</i><tt>></tt><b>]</b> <tt><img
|
|
src="../images/opt-end.gif" border="0">
|
|
</tt>
|
|
</pre>
|
|
|
|
<p>The following format shall be used for the <b>-T</b> option:</p>
|
|
|
|
<pre>
|
|
<tt>"%s %c %s %s\n" <</tt><i>name</i><tt>>, <</tt><i>terminal state</i><tt>>, <</tt><i>terminal name</i><tt>>,
|
|
<</tt><i>time of login</i><tt>>
|
|
</tt>
|
|
</pre>
|
|
|
|
<p>where <<i>terminal state</i>> is one of the following characters:</p>
|
|
|
|
<dl compact>
|
|
<dt><tt>+</tt></dt>
|
|
|
|
<dd>The terminal allows write access to other users.</dd>
|
|
|
|
<dt><tt>-</tt></dt>
|
|
|
|
<dd>The terminal denies write access to other users.</dd>
|
|
|
|
<dt><tt>?</tt></dt>
|
|
|
|
<dd>The terminal write-access state cannot be determined.</dd>
|
|
</dl>
|
|
|
|
<p>In the POSIX locale, the <<i>time of login</i>> shall be equivalent in format to the output of:</p>
|
|
|
|
<pre>
|
|
<tt>date +"%b %e %H:%M"
|
|
</tt>
|
|
</pre>
|
|
|
|
<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
|
|
format.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_171_11"></a>STDERR</h4>
|
|
|
|
<blockquote>
|
|
<p>The standard error shall be used only for diagnostic messages.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_171_12"></a>OUTPUT FILES</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_171_13"></a>EXTENDED DESCRIPTION</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_171_14"></a>EXIT STATUS</h4>
|
|
|
|
<blockquote>
|
|
<p>The following exit values shall be returned:</p>
|
|
|
|
<dl compact>
|
|
<dt> 0</dt>
|
|
|
|
<dd>Successful completion.</dd>
|
|
|
|
<dt>>0</dt>
|
|
|
|
<dd>An error occurred.</dd>
|
|
</dl>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_171_15"></a>CONSEQUENCES OF ERRORS</h4>
|
|
|
|
<blockquote>
|
|
<p>Default.</p>
|
|
</blockquote>
|
|
|
|
<hr>
|
|
<div class="box"><em>The following sections are informative.</em></div>
|
|
|
|
<h4><a name="tag_04_171_16"></a>APPLICATION USAGE</h4>
|
|
|
|
<blockquote>
|
|
<p>The name <i>init</i> used for the system process is the most commonly used on historical systems, but it may vary.</p>
|
|
|
|
<p>The "domain of accessibility" referred to is a broad concept that permits interpretation either on a very secure basis or even
|
|
to allow a network-wide implementation like the historical <i>rwho</i>.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_171_17"></a>EXAMPLES</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_171_18"></a>RATIONALE</h4>
|
|
|
|
<blockquote>
|
|
<p>Due to differences between historical implementations, the base options provided were a compromise to allow users to work with
|
|
those functions. The standard developers also considered removing all the options, but felt that these options offered users
|
|
valuable functionality. Additional options to match historical systems are available on XSI-conformant systems.</p>
|
|
|
|
<p>It is recognized that the <i>who</i> command may be of limited usefulness, especially in a multi-level secure environment. The
|
|
standard developers considered, however, that having some standard method of determining the "accessibility" of other users would
|
|
aid user portability.</p>
|
|
|
|
<p>No format was specified for the default <i>who</i> output for systems not supporting the XSI Extension. In such a user-oriented
|
|
command, designed only for human use, this was not considered to be a deficiency.</p>
|
|
|
|
<p>The format of the terminal name is unspecified, but the descriptions of <a href="../utilities/ps.html"><i>ps</i></a>, <a href=
|
|
"../utilities/talk.html"><i>talk</i></a>, and <a href="../utilities/write.html"><i>write</i></a> require that they use the same
|
|
format.</p>
|
|
|
|
<p>It is acceptable for an implementation to produce no output for an invocation of <i>who</i> <b>mil</b>.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_171_19"></a>FUTURE DIRECTIONS</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_171_20"></a>SEE ALSO</h4>
|
|
|
|
<blockquote>
|
|
<p><a href="mesg.html"><i>mesg</i></a></p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_171_21"></a>CHANGE HISTORY</h4>
|
|
|
|
<blockquote>
|
|
<p>First released in Issue 2.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_171_22"></a>Issue 6</h4>
|
|
|
|
<blockquote>
|
|
<p>This utility is marked as part of the User Portability Utilities option.</p>
|
|
|
|
<p>The <i>TZ</i> entry is added to the ENVIRONMENT VARIABLES section.</p>
|
|
</blockquote>
|
|
|
|
<div class="box"><em>End of informative text.</em></div>
|
|
|
|
<hr>
|
|
<hr size="2" noshade>
|
|
<center><font size="2"><!--footer start-->
|
|
UNIX ® is a registered Trademark of The Open Group.<br>
|
|
POSIX ® is a registered Trademark of The IEEE.<br>
|
|
[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
|
|
"../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>
|
|
]</font></center>
|
|
|
|
<!--footer end-->
|
|
<hr size="2" noshade>
|
|
</body>
|
|
</html>
|
|
|