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. Swift基础--使用TableViewController自定义列表

    首先建立一个swift项目,把storyboard的内容删掉,添加一个 Navigation Controller,然后设置storyboard对应界面的class,在Navigation Contr ...

  2. android——屏幕适配大全(转载)

    http://my.oschina.net/u/2008084/blog/496161 一.适配可行性 早在Android设计之初就考虑到了这一点,为了让app适应标准or山寨屏幕,google已经有 ...

  3. 关于jQuery获取checkbox状态的问题

    这位大神概括的很好 http://www.cnblogs.com/wangkongming/p/4002710.html

  4. javascript 之 this 用法

    参考视频:http://www.imooc.com/video/6430 JavaScript中的this比较灵活,也是让很多初学者摸不到头脑,那么根据在不同的环境下,在同一个函数,不同的调用方式下, ...

  5. html5前端开发笔记-个人中心

    简单的css自适应 PC端 *** 移动端 *** ) *** 一开始的想法就是模仿手机APP 的页面进行布局,首先得有个头部,然后是主题部分,然后加上2个按钮,分别是编辑和退出登录.先布出基本结构. ...

  6. JS中面向对象的,对象理解、构造函数、原型、原型链

    6.1 理解对象 6.1.1 对象属性类型 ECMS属性有两种类型:数据属性和访问器属性 1 数据属性 [[configurable]] 表示能否通过Delete 删除属性从而从新定义属性,能否修改属 ...

  7. Citrix 服务器虚拟化之十二 Xenserver灾难恢复

    Citrix 服务器虚拟化之十二 Xenserver灾难恢复 (环境有限实验无法测试,配置步骤摘取自官方文档) XenServer 灾难恢复的工作原理在存储库(SR)上还原从主(生产)环境复制到备份环 ...

  8. 单机/伪分布式Hadoop2.4.1安装文档

    转载自官方文档,最新版请见:http://hadoop.apache.org/docs/r2.4.1/hadoop-project-dist/hadoop-common/SingleCluster.h ...

  9. ajax 传值 中文乱码问题

    使用encodeURI编码内容 var Path = encodeURI("中文.xls"); url: "ashx/Data.ashx?Path =" + P ...

  10. 用PHP向MySql中写入图片

    我们经常遇到的问题是如何将图片文件放到Mysql数据库当中,这样可以避免没有认证的用户找到我们的图片资源! 1.看看数据库里的表结构怎么写 CREATE TABLE Images (     PicN ...