理解 `who -a` 命令的输出

dja*_*fan 16 utilities sshd

我问这个问题是因为,虽然互联网上有很多答案表明这who -a是一个选项,但没有人解释如何阅读输出。如果您可以提供一个指向解释这一点的在线网站的链接,那同样是一个很棒的答案。这是我想破译的一个例子:

[bo@hostname ~]$ who -a
                        Jun 17 03:47               590 id=si    term=0 exit=0
           system boot  Jun 17 03:47
           run-level 3  Jun 17 03:47                   last=S
                        Jun 17 03:48              4424 id=l3    term=0 exit=0
LOGIN      tty1         Jun 17 03:48              5503 id=1
LOGIN      tty2         Jun 17 03:48              5504 id=2
LOGIN      tty3         Jun 17 03:48              5505 id=3
LOGIN      tty4         Jun 17 03:48              5506 id=4
LOGIN      tty5         Jun 17 03:48              5507 id=5
LOGIN      tty6         Jun 17 03:48              5508 id=6
           pts/0        Oct 19 16:27             15250 id=ts/0  term=0 exit=0
bo       + pts/1        Oct 23 12:24   .         19776 (10.10.10.93)
           pts/2        Oct 23 13:07              8551 id=ts/2  term=0 exit=0
           pts/3        Oct 22 10:36              5813 id=ts/3  term=0 exit=0
           pts/4        Oct 10 09:06             13002 id=ts/4  term=0 exit=0
Run Code Online (Sandbox Code Playgroud)

rus*_*ush 14

正如你可以从 man who

-a, --all
      same as -b -d --login -p -r -t -T -u
Run Code Online (Sandbox Code Playgroud)

那么让我们来看看细节:

-b, --boot
      time of last system boot
Run Code Online (Sandbox Code Playgroud)

这是字符串 system boot Jun 17 03:47

-d, --dead
      print dead processes
Run Code Online (Sandbox Code Playgroud)

这是exit=0结尾的字符串

-l, --login
      print system login processes
Run Code Online (Sandbox Code Playgroud)

这是登录 ttys(LOGIN开头的字符串)

-p, --process
      print active processes spawned by init
Run Code Online (Sandbox Code Playgroud)

这个

-r, --runlevel
      print current runlevel
Run Code Online (Sandbox Code Playgroud)

这是 run-level 3 Jun 17 03:47 last=S

下一个是

-T, -w, --mesg
      add user's message status as +, - or ?
-u, --users
      list users logged in
Run Code Online (Sandbox Code Playgroud)

这两个字符串

bo       + pts/1        Oct 23 12:24   .         19776 (10.10.10.93)
Run Code Online (Sandbox Code Playgroud)

希望现在更清楚如何解析此输出。

  • 谢谢。这是关于如何阅读手册页的一个很好的教训。谢谢。 (2认同)