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

25 lines
1.4 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="w">w</h1>
<p>显示目前登入系统的用户信息</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>w命令</strong> 用于显示已经登陆系统的用户列表并显示用户正在执行的指令。执行这个命令可得知目前登入系统的用户有那些人以及他们正在执行的程序。单独执行w命令会显示所有的用户您也可指定用户名称仅显示某位用户的相关信息。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">w(选项)(参数)</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash"> -h, --no-header 不打印头信息;
-u, --no-current 当显示当前进程和cpu时间时忽略用户名
-s, --short 使用短输出格式;
-f, --from 显示用户从哪登录;
-o, --old-style 老式输出
-i, --ip-addr 显示IP地址而不是主机名如果可能
--help 显示此帮助并退出
-V, --version 显示版本信息。</code></pre>
<h3 id="参数">参数</h3>
<p>用户:仅显示指定用户。</p>
<h3 id="实例">实例</h3>
<pre><code class="language-bash">w
20:39:37 up 136 days, 3:58, 1 user, load average: 0.00, 0.00, 0.00
USER TTY FROM login@ IDLE JCPU PCPU WHAT
root pts/0 222.94.97.122 20:39 1.00s 0.00s 0.00s w</code></pre>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->