linux登录用户who,linux查看用户登录信息2-who命令

who命令与w命令相似,但要比w命令显示更加详细的信息。

[root@rusky opt]# man who

WHO(1) User Commands WHO(1)

NAME

who - show who is logged on

SYNOPSIS

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

DESCRIPTION

Print information about users who are currently logged in.

-a, --all

same as -b -d --login -p -r -t -T -u

-b, --boot

time of last system boot

-d, --dead

print dead processes

-H, --heading

print line of column headings

-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

--message

same as -T

--writable

same as -T

--help display this help and exit

--version

output version information and exit

============

常用who命令:

[root@rusky opt]# who

root pts/0 Dec 31 14:13 (192.168.1.111)

rusky1 pts/1 Dec 31 15:58 (192.168.1.111)

rusky1 pts/2 Dec 31 16:00 (192.168.1.111)

[root@rusky opt]# who-b --time of last system boot

system boot Dec27 05:06[root@rusky opt]# who-r ---print current runlevel

run-level 5 Dec 27 05:06[root@rusky opt]# who-q ---all login names and number of users logged on

root rusky1 rusky1

# users=3[root@rusky opt]# who-s

root pts/0 Dec 31 14:13 (192.168.1.111)

rusky1 pts/1 Dec 31 15:58 (192.168.1.111)

rusky1 pts/2 Dec 31 16:00 (192.168.1.111)

[root@rusky opt]# who-a

system boot Dec27 05:06run-level 5 Dec 27 05:06LOGIN tty3 Dec27 05:06 3508 id=3LOGIN tty2 Dec27 05:06 3506 id=2LOGIN tty4 Dec27 05:06 3510 id=4LOGIN tty5 Dec27 05:06 3514 id=5LOGIN tty6 Dec27 05:06 3516 id=6root+ pts/0 Dec 31 14:13 . 31733 (192.168.1.111)

rusky1+ pts/1 Dec 31 15:58 00:33 581 (192.168.1.111)

rusky1+ pts/2 Dec 31 16:00 00:39 581 (192.168.1.111)

pts/3 Dec 31 16:21 1084 id=ts/3 term=0 exit=0

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值