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.
-----------------------------------
[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命令的更多相关文章
- linux查看用户登录信息2-who命令
who命令与w命令相似,但要比w命令显示更加详细的信息.[root@rusky opt]# man who WHO(1) User Commands WHO(1) NAME who - show wh ...
- linux查看用户登录时间以及命令历史
1.查看当前登录用户信息 who命令: who缺省输出包括用户名.终端类型.登陆日期以及远程主机. who /var/log/wtmp 可以查看自从wtmp文件创建以来的每一次登陆情况 (1)-b:查 ...
- ref:linux查看用户登录时间以及命令历史
ref:https://blog.csdn.net/csdn924618338/article/details/73555725/ 1.查看当前登录用户信息 who命令: who缺省输出包括用户名.终 ...
- Linux查看用户登录信息-last
last命令: last命令用于显示用户最近登录信息.单独执行last命令,将读取 /var/log/wtmp 文件,并将给该文件的内容记录的登入系统的用户名单全部显示出来. 语法: last (选项 ...
- linux 用户管理(3)----查看用户登录时间以及命令历史
1.查看当前登录用户信息 who命令: who缺省输出包括用户名.终端类型.登陆日期以及远程主机. who /var/log/wtmp 可以查看自从wtmp文件创建以来的每一次登陆情况 (1)-b:查 ...
- linux查看用户登录,操作历史等
who 命令:显示当前当登录的用户的信息 who -b命令:显示系统最近一次的启动时间 w 命令:显示登录的用户及其当前执行的任务 last 命令:显示当前与过去登录系统的用户的信息 lastb 命令 ...
- Linux清除用户登录记录和命令历史方法(个人笔记)
清除登陆系统成功的记录 [root@localhost root]# echo > /var/log/wtmp //此文件默认打开时乱码,可查到ip等信息 [root@localhost roo ...
- (九)Linux查看用户登录的命令
用户登录查看命令 w 含义:就这么简单,一个字母w就是一个命令.查看登录用户信息. 输出的结果的含义: USER 登录的用户名 TTY 登录终端 FROM 从哪个I ...
- Linux - 查看用户登录记录
有关用户登录的信息记录在 utmp(/var/run/utmp).wtmp(/var/log/wtmp).btmp(/var/log/btmp) 和 lastlog(/var/log/lastlog) ...
随机推荐
- JAVA反射机制示例,读取excel数据映射到JAVA对象中
import java.beans.PropertyDescriptor; import java.io.File; import java.io.FileInputStream; import ja ...
- css-布局1-基本属性
<!DOCTYPE html>CSS4-布局1-基本属性 属性:displayvisibilityfloatclear HTML元素类型:行内元素,块级元素 块级元素:最大的区别:换行行内 ...
- a标签伪类的顺序
在一次开发项目中,我用a链接来做效果,测试的时候发现,a:hover被点击后的效果就不再了!我百度才知道,原来在css写a链接也是有顺序之分的. 顺序应该是: a:link a标签还未被访问的状态: ...
- IOS 实现QQ好友分组展开关闭功能
贴出核心代码 主要讲一下思路. - (void)nameBtnClick:(myButton *)sender { //获取当前点击的分组对应的section self.clickIndex = s ...
- (原)安装windows8.1和ubuntu16双系统及相互访问磁盘
转载请注明出处: http://www.cnblogs.com/darkknightzh/p/5638232.html 参考网址: http://jingyan.baidu.com/article/f ...
- SeekBar和RatingBar
今天在看一个音乐播放器的源代码时候用到了SeekBar,就翻出来mars老师的视频复习了一下,然后综合使用了一下. 首先先看下运行效果: 下来我们看看布局文件的设计: main.xml: < ...
- 在JS中调用JAVA变量
在JS中调用JAVA变量可以,方法是:var JS变量名 = “<%=JAVA变量名 %>”<%中间写java代码,跟在JSP中一样%>在JAVA中 ,无法调用JS变量
- Lucene学习总结之二:Lucene的总体架构
Lucene总的来说是: 一个高效的,可扩展的,全文检索库. 全部用Java实现,无须配置. 仅支持纯文本文件的索引(Indexing)和搜索(Search). 不负责由其他格式的文件抽取纯文本文件, ...
- 轻量级jquery框架之--布局(layout)
布局需求 (1)支持横向生成布局项即可,不需要纵向生成布局. (2)支持布局项右侧收缩功能 (3)支持自定义布局项图标.标题,并提供动态修改布局项图片和标题的api (4)支持JSON/html/if ...
- 我的开源框架之Accordion控件
需求: (1)实现手风琴面板控件,支持静态HTML与JSON方式创建控件 (2)支持远程加载数据 (3)支持面板激活.远程加载事件注册 (4)支持动态添加.删除项目 实现图例 客户代码 <div ...