Linux finger命令
Linux finger命令可以讓使用者查詢一些其他使用者的資料。會列出來的資料有:
- Login Name
- User Name
- Home directory
- Shell
- Login status
- mail status
- .plan
- .project
- .forward
其中 .plan、.project 和 .forward 就是使用者在他的 Home Directory 裏的 .plan , .project 和 .forward 等檔案裏的資料。如果沒有就沒有。finger 指令並不限定於在同一伺服器上查詢,也可以尋找某一個遠端伺服器上的使用者。只要給一個像是 E-mail address 一般的地址即可。
使用權限:所有使用者。
語法
finger [options] user[@address]
參數說明:
- -l 多行顯示。
- -s 單行顯示。這個選項只顯示登入名稱、真實姓名、終端機名稱、閒置時間、登入時間、辦公室號碼及電話號碼。如果所查詢的使用者是遠端伺服器的使用者,這個選項無效。
實例
列出當前登錄用戶的相關資訊
# finger -l //顯示用戶資訊 Login: root Name: root Directory: /root Shell: /bin/bash On since Fri Apr 9 20:17 (CST) on :0 (messages off) On since Fri Apr 9 20:17 (CST) on pts/1 32 days 22 hours idle On since Fri Apr 9 20:17 (CST) on pts/3 4 hours 5 minutes idle (messages off) On since Wed May 12 18:08 (CST) on pts/4 from 192.168.1.10 On since Wed May 12 18:35 (CST) on pts/5 from 192.168.1.10 7 minutes 54 seconds idle On since Wed May 12 14:37 (CST) on pts/2 from 192.168.1.10 3 hours 14 minutes idle On since Wed May 12 14:53 (CST) on pts/7 34 minutes 25 seconds idle (messages off) On since Wed May 12 16:53 (CST) on pts/8 from 192.168.1.10 30 minutes 18 seconds idle Mail last read Mon Mar 31 04:02 2008 (CST) No Plan.
顯示指定用戶資訊
# finger -m hnlinux
顯示遠程用戶資訊
# finger -m root@192.168.1.13
下列指令可以查詢本機管理員的資料:
finger root
其結果如下:
Login: root Name: root Directory: /root Shell: /bin/bash Never logged in. No mail. No Plan.