Latest web development tutorials

Linux w command

Linux command Daquan Linux command Daquan

Linux w command displays the currently logged in user information.

Implementation of this directive can know what the current, as well as the program they are performing a user has logged.

Performed separately w command displays all of the users, you can also specify a user name, a user display only the relevant information.

grammar

w [-fhlsuV][用户名称]

Parameter Description:

  • -f turn on or off the display where the user login system.
  • -h does not display the title of each column of the columns of information.
  • -l use the detailed list of formats, this is the default value.
  • -s terse format lists, no user login time, terminal phase of operations and procedures consuming CPU time.
  • -u ignore the name of the executable program, and the program information consuming CPU time.
  • -V Display version information.

Examples

Displays the current user

w  //显示当前用户,不显示登录位置
19:50:14 up 9:27, 4 users, load average: 0.31, 0.26, 0.18
USER   TTY   FROM       LOGIN@  IDLE  JCPU  PCPU WHAT
root   tty7   :0        Thu12  31:39m 10:10  0.60s gnome-session
root   pts/0  :0.0       17:09  2:18m 15.26s 0.15s bash
root   pts/1  192.168.1.17   18:51  1.00s 1.24s 0.14s -bash
root   pts/2  192.168.1.17   19:48  60.00s 0.05s 0.05s -bash

Hide login location

w -f
19:53:59 up 9:31, 4 users, load average: 0.05, 0.16, 0.15
USER   TTY    LOGIN@  IDLE  JCPU  PCPU WHAT
root   tty7   Thu12  31:43m 10:10  0.60s gnome-session
root   pts/0   17:09  2:21m 15.26s 0.15s bash
root   pts/1   18:51  0.00s 1.04s 0.14s -bash
root   pts/2   19:48  4:45  0.05s 0.05s -bash

In Lite mode display

w -s
19:54:37 up 9:31, 4 users, load average: 0.24, 0.19, 0.16
USER   TTY   FROM        IDLE WHAT
root   tty7   :0        31:43m gnome-session
root   pts/0  :0.0       2:22m bash
root   pts/1  192.168.1.17   0.00s -bash
root   pts/2  192.168.1.17   5:23 -bash

Does not display the title

w -h
root   tty7   :0        Thu12  31:44m 10:10  0.60s gnome-session
root   pts/0  :0.0       17:09  2:23m 15.26s 0.15s bash
root   pts/1  192.168.1.17   18:51  0.00s 1.05s 0.14s -bash
root   pts/2  192.168.1.17   19:48  5:54  0.05s 0.05s -bash

Linux command Daquan Linux command Daquan