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. css基本选择器

    CSS:层叠样式表 (Cascading Style Sheets) 结构层:HTML表现层: CSS行为层: DOM,JavaScript CSS语法结构:div{background:#f00;} ...

  2. ext.net中ComboBox空间实现模糊查询

    ComboBox中的属性添加Mode="Local"可以实现第一个字的模糊查询但是搜索中间的字无法实现 现提供一下方法使用正则表达式实现全模糊查询 <ext:ComboBox ...

  3. c3p0xml配置详解

    <?xml version="1.0" encoding="UTF-8"?> <c3p0-config> <default-con ...

  4. linux上备份Oracle时EXP-00091的错误解决方法

    unix/linux上备份Oracle时EXP-00091的错误解决方法 unix/linux上备份数据时的错误解决方法 EXP-00091: Exporting questionable stati ...

  5. A Bit Of Knowledge

    iOS推崇使用png格式的图片,说这样不会失帧 imageNamed 和 imageWithContentOfFile的区别 imageNamed会使用系统缓存,对重复加载的图片速度会快一些,效果好. ...

  6. 使用Spring JDBCTemplate简化JDBC的操作

    使用Spring JDBCTemplate简化JDBC的操作 接触过JAVA WEB开发的朋友肯定都知道Hibernate框架,虽然不否定它的强大之处,但个人对它一直无感,总感觉不够灵活,太过臃肿了. ...

  7. hadoop官网介绍及如何下载hadoop(2.4)各个版本与查看hadoop API介绍

    1.如何访问hadoop官网?2.如何下载hadoop各个版本?3.如何查看hadoop API? 很多同学开发都没有二手资料,原因很简单觉得不会英语,但是其实作为软件行业,多多少少大家会英语的,但是 ...

  8. 一大坨GoogleAPI的学习笔记之一(oAuth2.0)

    官方文档地址:https://developers.google.com/accounts/docs/OAuth2InstalledApp 最近Ubuntu下VGA接口无端的不能用了,木有心情翻译了, ...

  9. python-整理-logging日志

    python的日志功能模块是logging 功能和使用方式非常类似于log4 如何使用logging: # 导入日志模块import logging# 使用配置文件设置日志时,需要导入这个模块 imp ...

  10. winform 读取保存配置文件

    原文连接: public static string fileName = System.IO.Path.GetFileName(Application.ExecutablePath);        ...