2019-04-21 11:50:48 +08:00

36 lines
1.9 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1 id="who">who</h1>
<p>显示目前登录系统的用户信息</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>who命令</strong> 是显示目前登录系统的用户信息。执行who命令可得知目前有那些用户登入系统单独执行who命令会列出登入帐号使用的终端机登入时间以及从何处登入或正在使用哪个X显示器。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">who(选项)(参数)</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">-H或--heading显示各栏位的标题信息列
-i或-u或--idle显示闲置时间若该用户在前一分钟之内有进行任何动作将标示成&quot;.&quot;如果该用户已超过24小时没有任何动作则标示出&quot;old&quot;字符串;
-m此参数的效果和指定&quot;am i&quot;字符串相同;
-q或--count只显示登入系统的帐号名称和总人数
-s此参数将忽略不予处理仅负责解决who指令其他版本的兼容性问题
-w或-T或--mesg或--message或--writable显示用户的信息状态栏
--help在线帮助
--version显示版本信息。</code></pre>
<h3 id="参数">参数</h3>
<p>文件:指定查询文件。</p>
<h3 id="实例">实例</h3>
<pre><code class="language-bash">[root@localhost ~]# who
root pts/0 2013-08-19 15:04 (192.168.0.134)
root pts/1 2013-12-20 10:37 (180.111.155.40)
[root@localhost ~]# who -q
root root
# users=2
[root@localhost ~]# who -H
NAME LINE time COMMENT
root pts/0 2013-08-19 15:04 (192.168.0.134)
root pts/1 2013-12-20 10:37 (180.111.155.40)
[root@localhost ~]# who -w
root + pts/0 2013-08-19 15:04 (192.168.0.134)
root + pts/1 2013-12-20 10:37 (180.111.155.40)</code></pre>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->