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. 0..n去掉一个数,给你剩下的数,找出去掉的那个数

    转载请注明转自blog.csdn.net/souldak , 微博@evagle 首先,考虑没有去掉那些数,如果n是奇数,n+1个最低位肯定是0101...01,count(0)=count(1),如 ...

  2. 网络爬虫(3)--Beautiful页面解析

            前面2节中对页面内容的访问都是直接通过标签访问的,这样虽然也可以达到解析页面内容的目的,但是在网页复杂,页面结构发生变化时,爬虫就失效了.为了使爬虫能够更加鲁棒的工作,我们需要学习通过 ...

  3. JS数组追加数组采用push.apply的坑(转)

    JS数组追加数组没有现成的函数,这么多年我已经习惯了a.push.apply(a, b);这种自以为很酷的,不需要写for循环的写法,一直也没遇到什么问题,直到今天我要append的b是个很大的数组时 ...

  4. php + apache + mysql

    http://archive.apache.org/dist/httpd/binaries/win32/   Apache msi 下载地址

  5. 数据结构c++语言描述——最大堆(MaxHeap)

    一.最大堆的插入 图9-3a 给出了一个具有5个元素的最大堆.由于堆是完全二叉树,当加入一个元素形成6元素堆时,其结构必如9-3b 所示.如果插入元素的值为1,则插入后该元素成为2的左孩子,相反,若新 ...

  6. Xcode的代码片段快捷方式-Code Snippet Library(代码片段库)

    最近换了新电脑,装上Xcode敲代码发现很多以前攒的Code Snippet忘记备份了,总结了一下Code Snippet的设置方法,且行且添加,慢慢积累吧. 如下图:   Title - Code ...

  7. MySQL 基础 之 语句执行顺序

    FORM: 对FROM的左边的表和右边的表计算笛卡尔积.产生虚表VT1 ON: 对虚表VT1进行ON筛选,只有那些符合<join-condition>的行才会被记录在虚表VT2中. JOI ...

  8. POJ 2289 Jamie's Contact Groups (二分+最大流)

    题目大意: 有n个人,可以分成m个组,现在给出你每个人可以去的组的编号,求分成的m组中人数最多的组最少可以有多少人. 算法讨论: 首先喷一下这题的输入,太恶心了. 然后说算法:最多的最少,二分的字眼. ...

  9. 数值的N次方

    问题描述: 实现函数double Power(double base,int exponent),求base的exponent次方.不得使用库函数, 同时不需考虑大数问题. 思路分析: 要是你秒秒钟想 ...

  10. Javascript经典实例 - 正则表达式

    1] 正则常用字符 正则表达式常用的特殊字符 字符 匹配 示例 ^ 匹配输入的开始 /^This/匹配 “This is ...” $ 匹配输入的结束 /end$/匹配“This is the end ...