Linux命令详解之w命令

版权声明:如若转载,请联系作者。 https://blog.csdn.net/liu16659/article/details/83512855

Linux命令详解之w命令

1.命令详解

···
NAME
       w - Show who is logged on and what they are doing.

w命令就是用来展示谁在登录,以及他们在做什么。

DESCRIPTION
       w  displays  information  about  the  users currently on the machine, and their processes.  The header shows, in this order, the current time, how long the system has been running, how many
       users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes.

       The following entries are displayed for each user: login name, the tty name, the remote host, login time, idle time, JCPU, PCPU, and the command line of their current process.

       The JCPU time is the time used by all processes attached to the tty.  It does not include past background jobs, but does include currently running background jobs.

       The PCPU time is the time used by the current process, named in the "what" field.

w描述信息关于users当前在机器中的users,以及它们的进程。行首将以下面这个顺序展示:当前的时间,系统已经运行了多久,当前系统有多少用户在登录,系统在过去的1,5,15分钟的平均负载。
接下来的条目展示每个用户:登录名,tty 名,远程的(登录)主机,登录时间,空闲时间,JCPU,PCPU,以及当前进程的命令行。
JCPU时间是附加到所有的进程的使用时间。它不包括过去的后台程序,但是包括当前正在运行的后台程序。【不太理解】
PCPU时间是当前线程使用的时间,并在what域中展示出来。

```shell
COMMAND-LINE OPTIONS
       -h, --no-header
              Don't print the header.

       -u, --no-current
              Ignores the username while figuring out the current process and cpu times.  To demonstrate this, do a "su" and do a "w" and a "w -u".

       -s, --short
              Use the short format.  Don't print the login time, JCPU or PCPU times.

       -f, --from
              Toggle printing the from (remote hostname) field.  The default as released is for the from field to not be printed, although your system administrator or distribution maintainer  may
              have compiled a version in which the from field is shown by default.

       --help Display help text and exit.

       -i, --ip-addr
              Display IP address instead of hostname for from field.

       -V, --version
              Display version information.

       -o, --old-style
              Old style output.  Prints blank space for idle times less than one minute.

       user   Show information about the specified user only.

猜你喜欢

转载自blog.csdn.net/liu16659/article/details/83512855