Linux 下 who 命令


命令:

  who:

常用选项 意义
-a 显示所有用户的所有信息
-m 显示运行该程序的用户
-p 只显示用户的登陆帐号和登陆用户的数量,该选项优先级高于其他任何选项
-r 显示当前用户的运行级别,是在那个级别运行的
-u 在登陆用户后面显示该用户最后一次对系统进行操作距今的时间

  

 

 

 

 

参数:注:格式有点乱,

  -a, --all :

    系统引导 2014-05-30 00:32

    运行级别 2 2014-05-30 00:32

    登录 tty4 2014-05-30 00:32 932 id=4
    登录 tty5 2014-05-30 00:32 937 id=5
    登录 tty2 2014-05-30 00:32 944 id=2
    登录 tty3 2014-05-30 00:32 945 id=3
    登录 tty6 2014-05-30 00:32 947 id=6
    登录 tty1 2014-05-30 00:32 1182 id=1
    yufangqing + tty7 2014-05-30 00:33 旧 2320
    yufangqing - pts/0 2014-05-30 00:33 . 3168 (:0)

  -b, --boot :
    time of last system boot

    系统最后一次启动的时间

  -d, --dead :
    print dead processes

    打印已经被死亡的进程

  -H, --heading:

    print line of column headings

事例:  名称 线路 时间 备注

    yufangqing tty7 2014-05-30 00:33
    yufangqing pts/0 2014-05-30 00:33 (:0)

  --ips

    print ips instead of hostnames. with --lookup, canonicalizes
    based on stored IP, if available, rather than stored hostname

  -l, --login
    print system login processes

    打印当前系统登陆进程

  --lookup
    attempt to canonicalize hostnames via DNS

  -m

     only hostname and user associated with stdin

  -p, --process
    print active processes spawned by init

  

  -q, --count
    all login names and number of users logged on

  -r, --runlevel
    print current runlevel

  -s, --short
    print only name, line, and time (default)

  -t, --time
    print last system clock change

  -T, -w, --mesg
    add user's message status as +, - or ?

  -u, --users
    list users logged in

  

相关内容