who
who功能说明:显示目前登入系统的用户信息。
语 法:who [-Himqsw][--help][--version][am i][记录文件]
补充说明:执行这项指令可得知目前有那些用户登入系统,单独执行who指令会列出登入帐号,使用的
终端机,登入时间以及从何处登入或正在使用哪个X显示器。
参 数:
-H或--heading 显示各栏位的标题信息列。
-i或-u或--idle 显示闲置时间,若该用户在前一分钟之内有进行任何动作,将标示成"."号,如果该用户已超过24小时没有任何动作,则标示出"old"字符串。
-m 此参数的效果和指定"am i"字符串相同。
-q或--count 只显示登入系统的帐号名称和总人数。
-s 此参数将忽略不予处理,仅负责解决who指令其他版本的兼容性问题。
-w或-T或--mesg或--message或--writable 显示用户的信息状态栏。
--help 在线帮助。
--version 显示版本信息。
who
who [options] [file] who am i
Show who is logged into the system. With no options, list the names of users currently logged in, their terminal, the time they have been logged in, and the name of the host from which they have logged in. An optional system file (default is /etc/utmp) can be supplied to give additional information.
Options
Equivalent to -b -d --login -p -r -t -T -u.
Print the username of the invoking user.
Print time of last system boot.
Print a list of dead processes.
Print a help message and then exit.
Include idle times. An idle time of
. indicates activity within the last minute; one of old indicates no activity in more than a day.
Print list of system login processes.
Attempt to include canonical hostnames via DNS.
Same as who am i.
Print active processes spawned by init.
"Quick." Display only the usernames and total number of users.
Print the current runlevel.
Print only name, line, and time. This is the default behaviour.
Print the last system clock change.
Print a list of the users who are logged in.
Print version information and then exit.
Include user's message status in the output:
+ mesg y (write messages allowed)
- mesg n (write messages refused)
? Cannot find terminal device
-H, --heading Print headings.
Example
This sample output was produced at 8 a.m. on April 17:
$ who -uH NAME LINE TIME IDLE PID COMMENTS Earvin ttyp3 Apr 16 08:14 16:25 2240 Larry ttyp0 Apr 17 07:33 . 15182
Since Earvin has been idle since yesterday afternoon (16 hours), it appears that he isn't at work yet. He simply left himself logged in. Larry's terminal is currently in use.