who
who - show who is logged on
Print information about users who are currently logged in.
打印当前登录用户的信息.
- a --all 显示所有的登录信息
[posp@hadoop02 Kms]$ who -a
系统引导 2016-12-11 16:18
运行级别 5 2016-12-11 16:18
登录 tty4 2016-12-11 16:18 1961 id=4
登录 tty2 2016-12-11 16:18 1956 id=2
登录 tty3 2016-12-11 16:18 1959 id=3
登录 tty6 2016-12-11 16:18 1965 id=6
登录 tty5 2016-12-11 16:18 1963 id=5
root + pts/0 2017-02-24 10:10 旧的 15093 (hadoop01.uinpay.cn)
pts/1 2017-03-09 01:14 5696 id=ts/1 终端=0 退出=0
pts/2 2016-12-13 14:25 11150 id=ts/2 终端=0 退出=0
- q --count print all login names and number of users logged on
打印出所有登录用户的name和数量
[posp@hadoop02 Kms]$ who -q
root posp posp posp posp posp posp posp posp posp
# 用户数=10
H --heading print line of column headings
打印出行的头部信息who am i
[posp@hadoop02 log]$ who am i
posp pts/5 2017-03-08 09:59 (192.168.10.184)