1. 該公用程式的所在系統及路徑. Linux(Red Hat):{/usr/bin}

  2. 該公用程式所使用的 shared library. (可由 ldd 得到) libc.so.6 => /lib/libc.so.6 (0x4002c000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

  3. 該公用程式的主要用途說明. 顯示誰在這台機器上

  4. 儘可能地說明該公用程式所支援的參數及其意義.
  5. 儘可能地提供配合各種參數的使用範例. WHO(1) FSF WHO(1)

NAME#名稱

who - show who is logged on#顯示現在誰在登入這台機器上

SYNOPSIS#概要

who [OPTION]... [ FILE | ARG1 ARG2 ]

DESCRIPTION#描述

-H, --heading

print line of column headings#列出每一行的所代表的意思
EX:USER LINE LOGIN-TIME FROM
Erif pts/0 Oct 5 11:41
yckuo pts/1 Oct 5 14:29
yckuo pts/2 Oct 5 14:36

-i, -u, --idle

add user idle time as HOURS:MINUTES, . or old#額外顯示使用者閒置的時間
EX:Erif pts/0 Oct 5 11:41 02:33
yckuo pts/1 Oct 5 14:29 00:12
yckuo pts/2 Oct 5 14:36 .

-l, --lookup

  attempt to canonicalize hostnames via DNS#藉由DNS查出標準的來源主機名稱
EX:Erif pts/0 Oct 5 11:41 (Erif.Dorm13.NCTU.edu.tw)
yckuo pts/1 Oct 5 15:00 (yuki.Dorm8.NCTU.edu.tw)
yckuo pts/2 Oct 5 15:00 (yuki.Dorm8.NCTU.edu.tw)
-m only hostname and user associated with stdin#只顯示來源主機名稱以及使用者資訊
intel4.csie.nctu.edu.tw!yckuo pts/2 Oct 5 15:00

-q, --count

all login names and number of users logged on#列出所有登入的使用者和總數 EX:Erif yckuo yckuo

# users=3

-s (ignored)#就跟who一樣,內定的參數值

-T, -w, --mesg

add user's message status as +, - or ?#顯示使用者訊息狀態
EX:Erif + pts/0 Oct 5 11:41
yckuo + pts/1 Oct 5 15:00
yckuo + pts/2 Oct 5 15:00

--message

same as -T#和參數-w, -T一樣的用法

--writable

same as -T#和參數-w, -T一樣的用法

--help display this help and exit#顯示說明文件

--version

output version information and exit#查詢版本資訊


REPORTING BUGS#回報臭蟲

Report bugs to .

SEE ALSO#額外參考文件

The full documentation for who is maintained as a Texinfo
manual. If the info and who programs are
installed at your site, the command
properly

info who

should give you access to the complete manual.

COPYRIGHT#版權資訊

Copyright ?1999 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

GNU sh-utils 2.0 August 1999




who

  1. 所在系統Linux RedHat及路徑 /bin/who
  2. hpchen@ccsun13:/bin 507 >ldd who libc.so.1 => /usr/lib/libc.so.1 libdl.so.1 => /usr/lib/libdl.so.1 /usr/platform/SUNW,Ultra-60/lib/libc_psr.so.1
  3. 主要用途說明 顯示目前登入系統的使用者資訊
  4. 所支援的參數及其意義

ami 只列出與自己相關的登入資訊
-H or --heading 顯示各欄位的標題列

-I or –u or –idle 顯示閒置時間,若該使用著在前一分鐘錢之內有進行任何行動,將標示成”.”,如果該使用者已超過24 小時沒有任何動作,則標示出”old”字串
-m 此參數之效果和指定”ami”字串相同
-q or –count 只顯示出登入系統的帳號行稱和M總人數,使用本參數將忽略其它參數
-s 此參數忽略不予處理,僅負責解決who指令其孕扛岩貌漪萛e性問題
-w –T –mesg –message –writable 顯示使用者的訊息狀態攔。訊息之狀態標示共有3種:”+”、”-”和”?”,分別代表接受write指令傳 來的訊息,不接受write指令的訊息,以及找不到終端機周邊設備
--help 顯示線上說明
--version 顯示版本訊息


  1. 補充說明 who [am i][-Himqsw][-help][--version][紀錄檔] 執行這項指令可以得知目前有哪些使用者登入系統,單獨執行who指令會列出登入帳號、使用之終端機,以及從何處登入或正在使用哪個X顯示器。

可在who指令後面加上紀錄檔的名稱,取代存放在/var/log目錄下的wtmp檔案,用來查詢以前的使用者登入紀錄。假設加在who後面的字串是”am I”,則會顯示本地主機名稱和本帳號的相關資訊


/*系統路徑*/
我使用的系統是 RedHat 7.0
而who這個指令是放在 /usr/bin 下

/*shared library*/
who這個指令所用到的shared library有
libc.so.6,ld-linux.so.2

/*主要用途說明*/
可用來看目前logged on此機器的users有誰以及其登入時間

/*支援的參數及其意義*/
[northstar@FROZENN ~]$ who
northstar pts/0 Oct 5 00:59
//很單純的顯示了user的一些資訊

[northstar@FROZENN ~]$ who -H
USER LINE LOGIN-TIME FROM
northstar pts/0 Oct 5 00:59
//我們可以看到跟who相比多了一行英文,用來表示每個message代表的意義

[northstar@FROZENN ~]$ who -i
northstar pts/0 Oct 5 00:59 .
[northstar@FROZENN ~]$ who -u
northstar pts/0 Oct 5 00:59 .
//下 -i 跟 -u 都是可以顯示所有users idle的時間,不過因為只有我自己一個user,而我剛
//下過指令,所以idle時間為0,因此只顯示一個點,沒有時間


[northstar@FROZENN ~]$ who -l
northstar pts/0 Oct 5 00:59 (ccsun3.csie.nctu.edu.tw)

[northstar@FROZENN ~]$ who -m

FROZENN.Dorm13.NCTU.edu.tw!northstar pts/0
//user登入的主機名稱及登入的帳號
Oct 5 00:59

[northstar@FROZENN ~]$ who -q
northstar

# users=1  
//列出線上所有users並於# users=統計人數
[northstar@FROZENN ~]$ who -s
northstar pts/0 Oct
//同不加任何參數
5 00:59
[northstar@FROZENN ~]$ who -T
northstar + pts/0
//這個我真的不知道了@@
Oct 5 00:59

[northstar@FROZENN ~]$ who --version
who (GNU sh-utils) 2.0

Written by Joseph Arceneaux and David MacKenzie.
//show出此RedHat的版本


[northstar@FROZENN ~]$ who --help
Usage: who [OPTION]... [ FILE | ARG1 ARG2 ]

-H, --heading print line of column headings
-i, -u, --idle add user idle time as HOURS:MINUTES, . or old
-l, --lookup attempt to canonicalize hostnames via DNS
-m   only hostname and user associated with stdin
-q, --count all login names and number of users logged on
-s   (ignored)
-T, -w, --mesg add user's message status as +, - or ?
  --message same as -T
  --writable same as -T
  --help display this help and exit
  --version output version information and exit

If FILE is not specified, use /var/run/utmp. /var/log/wtmp as FILE is common. If ARG1 ARG2 given, -m presumed: `am i' or `mom likes' are usual.

Report bugs to .
//show出who這個指令的求救(help)畫面,包含可加的參數