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.
-----------------------------------

[root@rusky opt]# w
:: up days, :, users, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/ 192.168.1.110 : .00s .28s .00s w
rusky1 pts/ 192.168.1.110 : : .03s .02s bash
rusky1 pts/ 192.168.1.110 : : .02s .02s -bash
test pts/ 192.168.1.111 : : .05s .02s vim vi [root@rusky opt]# w --help
w: invalid option -- '-'
usage: w -hlsufV [user]
-h skip header
-l long listing (default)
-s short listing
-u ignore uid of processes
-f toggle FROM field (default on)
-V display version [root@rusky opt]# w -h
root pts/ 192.168.1.110 : .00s .28s .00s w -h
rusky1 pts/ 192.168.1.110 : : .03s .02s bash
rusky1 pts/ 192.168.1.110 : : .02s .02s -bash
test pts/ 192.168.1.222 : : .05s .02s vim vi [root@rusky opt]# w -l
:: up days, :, users, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/ 192.168.1.110 : .00s .28s .00s w -l
rusky1 pts/ 192.168.1.110 : : .03s .02s bash
rusky1 pts/ 192.168.1.110 : : .02s .02s -bash [root@rusky opt]# w -s
:: up days, :, users, load average: 0.00, 0.00, 0.00
USER TTY FROM IDLE WHAT
root pts/ 192.168.1.110 .00s w -s
rusky1 pts/ 192.168.1.110 : bash
rusky1 pts/ 192.168.1.110 : -bash [root@rusky opt]# w -u
:: up days, :, users, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/ 192.168.1.110 : .00s .28s .00s w -u
rusky1 pts/ 192.168.1.110 : : .03s .02s bash
rusky1 pts/ 192.168.1.110 : : .02s .02s -bash [root@rusky opt]# w -f
:: up days, :, users, load average: 0.00, 0.00, 0.00
USER TTY LOGIN@ IDLE JCPU PCPU WHAT
root pts/ : .00s .28s .00s w -f
rusky1 pts/ : : .03s .02s bash
rusky1 pts/ : : .02s .02s -bash [root@rusky opt]# w -V
procps version 3.2.

linux查看用户登录信息-w命令的更多相关文章

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

    who命令与w命令相似,但要比w命令显示更加详细的信息.[root@rusky opt]# man who WHO(1) User Commands WHO(1) NAME who - show wh ...

  2. linux查看用户登录时间以及命令历史

    1.查看当前登录用户信息 who命令: who缺省输出包括用户名.终端类型.登陆日期以及远程主机. who /var/log/wtmp 可以查看自从wtmp文件创建以来的每一次登陆情况 (1)-b:查 ...

  3. ref:linux查看用户登录时间以及命令历史

    ref:https://blog.csdn.net/csdn924618338/article/details/73555725/ 1.查看当前登录用户信息 who命令: who缺省输出包括用户名.终 ...

  4. Linux查看用户登录信息-last

    last命令: last命令用于显示用户最近登录信息.单独执行last命令,将读取 /var/log/wtmp 文件,并将给该文件的内容记录的登入系统的用户名单全部显示出来. 语法: last (选项 ...

  5. linux 用户管理(3)----查看用户登录时间以及命令历史

    1.查看当前登录用户信息 who命令: who缺省输出包括用户名.终端类型.登陆日期以及远程主机. who /var/log/wtmp 可以查看自从wtmp文件创建以来的每一次登陆情况 (1)-b:查 ...

  6. linux查看用户登录,操作历史等

    who 命令:显示当前当登录的用户的信息 who -b命令:显示系统最近一次的启动时间 w 命令:显示登录的用户及其当前执行的任务 last 命令:显示当前与过去登录系统的用户的信息 lastb 命令 ...

  7. Linux清除用户登录记录和命令历史方法(个人笔记)

    清除登陆系统成功的记录 [root@localhost root]# echo > /var/log/wtmp //此文件默认打开时乱码,可查到ip等信息 [root@localhost roo ...

  8. (九)Linux查看用户登录的命令

    用户登录查看命令 w 含义:就这么简单,一个字母w就是一个命令.查看登录用户信息. 输出的结果的含义: USER       登录的用户名 TTY        登录终端 FROM      从哪个I ...

  9. Linux - 查看用户登录记录

    有关用户登录的信息记录在 utmp(/var/run/utmp).wtmp(/var/log/wtmp).btmp(/var/log/btmp) 和 lastlog(/var/log/lastlog) ...

随机推荐

  1. SmaterWeatherApi---签名加密和数据訪问--简单粗暴一步搞定

    -----------------------------------------------------更新-2014-07-09---------------------------------- ...

  2. MFC读写配置文件

    void CFileTextDoc::OnIniread() { // TODO: Add your command handler code here CString strStudName;   ...

  3. java获取当前系统毫秒,纳秒

    //获取当前系统毫秒 System.out.println(System.currentTimeMillis()); //获取当前系统纳秒 System.out.println(System.nano ...

  4. Linux内核:sk_buff解析

    sk_buff 目录 1 sk_buff介绍 2 sk_buff组成 3 struct sk_buff 结构体 4 sk_buff成员变量 4.1 Layout布局 4.2 General通用 4.3 ...

  5. Oracle监听静态注册和动态注册

    静态注册和动态注册总结 一.什么是注册? 注册就是将数据库作为一个服务注册到监听程序.客户端不需要知道数据库名和实例名,只需要知道该数据库对外提供的服务名就可以申请连接到数据库.这个服务名可能与实例名 ...

  6. js判断是否是数字通用写法

    function isNumber(value){ var isNumber = value.match(/^(-?\d+)(\.\d+)?$/g) !=null; if(value.substrin ...

  7. (转)SQL Server 触发器

    SQL Server 触发器 触发器是一种特殊类型的存储过程,它不同于之前的我们介绍的存储过程.触发器主要是通过事件进行触发被自动调用执行的.而存储过程可以通过存储过程的名称被调用. Ø 什么是触发器 ...

  8. Cisco cmd 命令(二)

    1.配置路由器静态路由选择表 ip route [destination_network] [mask] [next_hop_address or exitinterface] [administra ...

  9. git merge的recursive策略和merge-base

    git的合并策略总共有3种,一种是resovle,一种是recursive,一种是octopus.其中resolve和recursive适用于合并2个branch,octopus适用于合并3个或者3个 ...

  10. FileAttributes枚举

    FileAttributes枚举是一个专门用于标记硬盘上的文件属性的枚举,枚举的说明在这里:http://www.cnblogs.com/kissdodog/archive/2013/01/16/28 ...