linux who命令參數(shù)及用法詳解(linux查看在線用戶命令)
發(fā)布日期:2022-04-07 19:37 | 文章來源:CSDN
linux who 命令 詳解 Linux最常用命令之一
功能說明:顯示目前登入系統(tǒng)的用戶信息。
語 法:who [-Himqsw][--help][--version][am i][記錄文件]
補(bǔ)充說明:執(zhí)行這項(xiàng)指令可得知目前有那些用戶登入系統(tǒng),單獨(dú)執(zhí)行who指令會(huì)列出登入帳號,使用的
終端機(jī),登入時(shí)間以及從何處登入或正在使用哪個(gè)X顯示器。
參 數(shù):
-H或--heading 顯示各欄位的標(biāo)題信息列。
-i或-u或--idle 顯示閑置時(shí)間,若該用戶在前一分鐘之內(nèi)有進(jìn)行任何動(dòng)作,將標(biāo)示成"."號,如果該用戶已超過24小時(shí)沒有任何動(dòng)作,則標(biāo)示出"old"字符串。
-m 此參數(shù)的效果和指定"am i"字符串相同。
-q或--count 只顯示登入系統(tǒng)的帳號名稱和總?cè)藬?shù)。www.jb51.com linux安全網(wǎng)
擴(kuò)展,使用who或者w命令查看到非法用戶正在登陸系統(tǒng),想踢掉怎么辦
who命令示例
要顯示關(guān)于誰正在使用本地系統(tǒng)節(jié)點(diǎn)的信息,請輸入:
who
顯示類似于以下內(nèi)容的信息:
joe lft/0 Jun 8 08:34
要顯示您的用戶名,請輸入:
who am i
顯示類似于以下內(nèi)容的信息:
george lft/0 Jun 8 08:34
要顯示登錄、注銷、系統(tǒng)啟動(dòng)和系統(tǒng)關(guān)閉的歷史記錄,請輸入:
who /var/adm/wtmp
顯示類似于以下內(nèi)容的信息:
hank lft/0 Jun 8 08:34 (ausnix5)
john lft/0 Jun 8 08:34 (JIKey)
mary lft/0 Jun 8 08:22 (machine.austin.ibm)
jan pts4 Jun 8 09:19 (puff.wisc.edu)
要顯示本地系統(tǒng)節(jié)點(diǎn)的運(yùn)行級別,請輸入:
who -r
顯示類似于以下內(nèi)容的信息:
. run-level 2 Jun 8 04:15 2 0 s
要顯示任何當(dāng)前活動(dòng)的和以前已由 init 生成的活動(dòng)進(jìn)程,請輸入:
who -p
顯示類似于以下內(nèi)容的信息
srcmstr . Jun 8 04:15 old 2896
cron . Jun 8 04:15 old 4809
uprintfd . Jun 8 04:15 old 5158
要通過指定 -bdlprtTu 標(biāo)志來處理 /var/adm/wtmp 文件,請輸入:
who -a /var/adm/wtmp
顯示類似于以下內(nèi)容的信息:
. system boot Jun 19 10:13
. run-level 2 Jun 19 10:13
. . Jun 19 10:14 old
. . Jun 19 10:14 old
. . Jun 19 10:14 old
rc - . Jun 19 10:13 old
. . Jun 19 10:16 old
. . Jun 19 10:14 old
srcmstr - . Jun 19 10:14 old
rctcpip - . Jun 19 10:14 old
rcdce - . Jun 19 10:14 old
rccm - . Jun 19 10:15 old
dceupdt - . Jun 19 10:15 old
rcnfs - . Jun 19 10:15 old
cron - . Jun 19 10:16 old
piobe - . Jun 19 10:16 old
qdaemon - . Jun 19 10:16 old
writesrv - . Jun 19 10:16 old
uprintfd - . Jun 19 10:16 old
. . Jun 19 10:16 old
LOGIN - lft0 Jun 19 10:16 old
. . Jun 19 10:16 old
. . Jun 19 10:16 old
功能說明:顯示目前登入系統(tǒng)的用戶信息。
語 法:who [-Himqsw][--help][--version][am i][記錄文件]
補(bǔ)充說明:執(zhí)行這項(xiàng)指令可得知目前有那些用戶登入系統(tǒng),單獨(dú)執(zhí)行who指令會(huì)列出登入帳號,使用的
終端機(jī),登入時(shí)間以及從何處登入或正在使用哪個(gè)X顯示器。
參 數(shù):
-H或--heading 顯示各欄位的標(biāo)題信息列。
-i或-u或--idle 顯示閑置時(shí)間,若該用戶在前一分鐘之內(nèi)有進(jìn)行任何動(dòng)作,將標(biāo)示成"."號,如果該用戶已超過24小時(shí)沒有任何動(dòng)作,則標(biāo)示出"old"字符串。
-m 此參數(shù)的效果和指定"am i"字符串相同。
-q或--count 只顯示登入系統(tǒng)的帳號名稱和總?cè)藬?shù)。www.jb51.com linux安全網(wǎng)
擴(kuò)展,使用who或者w命令查看到非法用戶正在登陸系統(tǒng),想踢掉怎么辦
who命令示例
要顯示關(guān)于誰正在使用本地系統(tǒng)節(jié)點(diǎn)的信息,請輸入:
who
顯示類似于以下內(nèi)容的信息:
joe lft/0 Jun 8 08:34
要顯示您的用戶名,請輸入:
who am i
顯示類似于以下內(nèi)容的信息:
george lft/0 Jun 8 08:34
要顯示登錄、注銷、系統(tǒng)啟動(dòng)和系統(tǒng)關(guān)閉的歷史記錄,請輸入:
who /var/adm/wtmp
顯示類似于以下內(nèi)容的信息:
hank lft/0 Jun 8 08:34 (ausnix5)
john lft/0 Jun 8 08:34 (JIKey)
mary lft/0 Jun 8 08:22 (machine.austin.ibm)
jan pts4 Jun 8 09:19 (puff.wisc.edu)
要顯示本地系統(tǒng)節(jié)點(diǎn)的運(yùn)行級別,請輸入:
who -r
顯示類似于以下內(nèi)容的信息:
. run-level 2 Jun 8 04:15 2 0 s
要顯示任何當(dāng)前活動(dòng)的和以前已由 init 生成的活動(dòng)進(jìn)程,請輸入:
who -p
顯示類似于以下內(nèi)容的信息
srcmstr . Jun 8 04:15 old 2896
cron . Jun 8 04:15 old 4809
uprintfd . Jun 8 04:15 old 5158
要通過指定 -bdlprtTu 標(biāo)志來處理 /var/adm/wtmp 文件,請輸入:
who -a /var/adm/wtmp
顯示類似于以下內(nèi)容的信息:
. system boot Jun 19 10:13
. run-level 2 Jun 19 10:13
. . Jun 19 10:14 old
. . Jun 19 10:14 old
. . Jun 19 10:14 old
rc - . Jun 19 10:13 old
. . Jun 19 10:16 old
. . Jun 19 10:14 old
srcmstr - . Jun 19 10:14 old
rctcpip - . Jun 19 10:14 old
rcdce - . Jun 19 10:14 old
rccm - . Jun 19 10:15 old
dceupdt - . Jun 19 10:15 old
rcnfs - . Jun 19 10:15 old
cron - . Jun 19 10:16 old
piobe - . Jun 19 10:16 old
qdaemon - . Jun 19 10:16 old
writesrv - . Jun 19 10:16 old
uprintfd - . Jun 19 10:16 old
. . Jun 19 10:16 old
LOGIN - lft0 Jun 19 10:16 old
. . Jun 19 10:16 old
. . Jun 19 10:16 old
版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。
相關(guān)文章
關(guān)注官方微信