linux用户信心查看命令,linux查看用户登录信息-w命令

NAME

w - Show who is logged on and what they are doing.

SYNOPSIS

w - [husfV] [user]

DESCRIPTION

w displays information about the users currently on the machine, and their processes. The header shows, in

this order, the current time, how long the system has been running, how many users are currently logged on,

and the system load averages for the past 1, 5, and 15 minutes.

The following entries are displayed for each user: login name, the tty name, the remote host, login time, idle

time, JCPU, PCPU, and the command line of their current process.

The JCPU time is the time used by all processes attached to the tty. It does not include past background jobs,

but does include currently running background jobs.

The PCPU time is the time used by the current process, named in the "what" field.

COMMAND-LINE OPTIONS

-h Don‘t print the header.

-u Ignores the username while figuring out the current process and cpu times. To demonstrate this, do a "su"

and do a "w" and a "w -u".

-s Use the short format. Don‘t print the login time, JCPU or PCPU times.

-f Toggle printing the from (remote hostname) field. The default as released is for the from field to not be

printed, although your system administrator or distribution maintainer may have compiled a version in

which the from field is shown by default.

-V Display version information.

user Show information about the specified user only.

-----------------------------------

16:14:50 up 4 days, 11:09, 4 users, load average: 0.00, 0.00, 0.00USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT

root pts/0 192.168.1.110 14:13 0.00s 0.28s 0.00s w

rusky1 pts/1 192.168.1.110 15:58 8:27 0.03s 0.02s bash

rusky1 pts/2 192.168.1.110 16:00 13:56 0.02s 0.02s -bash

test pts/3 192.168.1.111 16:04 1:51 0.05s 0.02s vim vi

[[email protected] opt]# w--help

w: invalid option-- ‘-‘usage: w-hlsufV [user]-h skip header-l long listing (default)-s shortlisting-u ignore uid of processes-f toggle FROM field (defaulton)-V display version

[[email protected] opt]# w-h

root pts/0 192.168.1.110 14:13 0.00s 0.28s 0.00s w -h

rusky1 pts/1 192.168.1.110 15:58 8:46 0.03s 0.02s bash

rusky1 pts/2 192.168.1.110 16:00 14:15 0.02s 0.02s -bash

test pts/3 192.168.1.222 16:04 2:10 0.05s 0.02s vim vi

[[email protected] opt]# w-l16:15:20 up 4 days, 11:10, 3 users, load average: 0.00, 0.00, 0.00USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT

root pts/0 192.168.1.110 14:13 0.00s 0.28s 0.00s w -l

rusky1 pts/1 192.168.1.110 15:58 8:57 0.03s 0.02s bash

rusky1 pts/2 192.168.1.110 16:00 14:26 0.02s 0.02s -s16:15:29 up 4 days, 11:10, 3 users, load average: 0.00, 0.00, 0.00USER TTY FROM IDLE WHAT

root pts/0 192.168.1.110 0.00s w -s

rusky1 pts/1 192.168.1.110 9:06bash

rusky1 pts/2 192.168.1.110 14:35 -u16:15:36 up 4 days, 11:10, 3 users, load average: 0.00, 0.00, 0.00USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT

root pts/0 192.168.1.110 14:13 0.00s 0.28s 0.00s w -u

rusky1 pts/1 192.168.1.110 15:58 9:13 0.03s 0.02s bash

rusky1 pts/2 192.168.1.110 16:00 14:42 0.02s 0.02s -f16:15:47 up 4 days, 11:10, 3 users, load average: 0.00, 0.00, 0.00USER TTY LOGIN@ IDLE JCPU PCPU WHAT

root pts/0 14:13 0.00s 0.28s 0.00s w -f

rusky1 pts/1 15:58 9:24 0.03s 0.02s bash

rusky1 pts/2 16:00 14:53 0.02s 0.02s -V

procps version3.2.8

原文:http://www.cnblogs.com/rusking/p/4195997.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值