Linux 下查看系统当前登录用户信息
当你新登录一个主机,过着管理一个主机,这时候你就需要这些命令来进行查看了:
1. w : Show who is logged on and what they are doing.
w [options] user [...]
常用命令:
w -h --no-header
w -u --no-current
w -s : Use the short format. Don't print the login time, JCPU or PCPU times.
w -i, --ip-addr : Display IP address instead of hostname for from field.
2. who : Show who is logged on
who -a, --all 展示所有的; 相当于 使用 -b -d --login -p -r -t -T -u
3. users: Print the user names of users currently logged in to the current host
4. whoami : Print effective userid
Print the user name associated with the current effective user ID. Same as id -un.
5. last : last, lastb - show a listing of last logged in users
last -a
last [options] [username...] [tty...]
last searches back through the /var/log/wtmp file (or the file designated by the -f option) and displays a list of all users logged in
(and out) since that file was created. One or more usernames and/or ttys can be given, in which case last will show only the entries
matching those arguments. Names of ttys can be abbreviated, thus last 0 is the same as last tty0. When catching a SIGINT signal (generated by the interrupt key, usually control-C) or a SIGQUIT signal, last will show how far it has
searched through the file; in the case of the SIGINT signal last will then terminate. The pseudo user reboot logs in each time the system is rebooted. Thus last reboot will show a log of all the reboots since the log file
was created. lastb is the same as last, except that by default it shows a log of the /var/log/btmp file, which contains all the bad login attempts.
last reboot 展示所有的机器重新启动的情况。
6. lastb:lastb is the same as last, except that by default it shows a log of the /var/log/btmp file, which contains all the bad login attempts.
在root 权限下,使用 lastb 命令,将会显示所有尝试登录失败的情况。
保持更新,转载请注明出处。
Linux 下查看系统当前登录用户信息的更多相关文章
- linux 下如何查看和踢除正在登陆的其它用户 ==>Linux下用于查看系统当前登录用户信息的4种方法
在linux系统中用pkill命令踢出在线登录用户 由于linux服务器允许多用户登录,公司很多人知道密码,工作造成一定的障碍 所以需要有时踢出指定的用户 1/#who 查出当前有那些终端登录(用 ...
- Linux下用于查看系统当前登录用户信息 w命令
作为系统管理员,你可能经常会(在某个时候)需要查看系统中有哪些用户正在活动.有些时候,你甚至需要知道他(她)们正在做什么.本文为我们总结了4种查看系统用户信息(通过编号(ID))的方法. 1. 使用w ...
- CentOS下用于查看系统当前登录用户信息的4种方法
作为系统管理员,你可能经常会(在某个时候)需要查看系统中有哪些用户正在活动.有些时候,你甚至需要知道他(她)们正在做什么.本文为我们总结了4种查看系统用户信息(通过编号(ID))的方法. 1. 使用w ...
- Linux下用于查看系统当前登录用户信息的4种方法
1. 使用w命令查看登录用户正在使用的进程信息 w命令用于显示已经登录系统的用户的名称,以及他们正在做的事.该命令所使用的信息来源于/var/run/utmp文件.w命令输出的信息包括: 用户名称 用 ...
- Linux下查看/管理当前登录用户及用户操作历史记录
转载自: http://www.cnblogs.com/gaojun/archive/2013/10/24/3385885.html 一.查看及管理当前登录用户 1.使用w命令查看登录用户正在使用的进 ...
- 请给出linux中查看系统已经登录用户的命令?
w命令 第一行:当前系统运行了多久和系统负载 谁正在远程登录系统并且在干什么 [root@martin ~]# w 11:30:33 up 4 days, 18:10, 2 users, load a ...
- Linux查看系统当前登录用户的命令,top命令看到users有多个用户登录
Linux查看系统当前登录用户的命令,top命令看到users有多个用户登录 作为系统管理员,top命令看到users有多个用户登录,会需要查看下是否被黑客进入了. 实战例子:top命令:top - ...
- Linux下查看网卡驱动和版本信息
Linux下查看网卡驱动和版本信息 查看网卡生产厂商和信号 查看基本信息:lspci 查看详细信息:lspci -vvv # 3个小写的v 查看网卡信息:lspci | grep Ethernet 查 ...
- Linux下查看Tomcat的控制台输出信息
Linux下查看Tomcat的控制台输出信息 首先使用SSH连接到数据库,然后点击window创建一个new terminal, 进入tomcat/logs/文件夹下,输出控制台信息,命令如下: cd ...
随机推荐
- 如何在Mac下配置Github和Bitbucket的SSH
--- title: 如何在Mac下配置Github和Bitbucket的SSH date: 2017-12-23 21:10:30 tags: - Mac - Git - Github catego ...
- 分布式高性能消息系统(Kafka MQ)的原理与实践
一.关于Kafka的一些概念和理解 Kafka是一个分布式的数据流平台,它基于独特日志文件形式,提供了高性能消息系统功能.也可以用于大数据流管道. Kafka维护了按目录划分的消息订阅源,称之为 To ...
- ES6学习总结
const只能保证这个指针是固定的,至于它指向的数据结构是不是可变的,就完全不能控制了 const foo = {}; // 为 foo 添加一个属性,可以成功 foo.prop = 123; foo ...
- PHP-CPP开发扩展(五)
PHP-CPP是一个用于开发PHP扩展的C++库.本节讲解如何在C++中实现PHP类. 类和对象 类和对象 怎样在PHP-CPP里写出PHP的类呢?很简单,看下面的例子: main.cpp /** * ...
- 开源网站流量统计系统Piwik源码分析——后台处理(二)
在第一篇文章中,重点介绍了脚本需要搜集的数据,而本篇主要介绍的是服务器端如何处理客户端发送过来的请求和参数. 一.设备信息检测 通过分析User-Agent请求首部(如下图红线框出的部分),可以得到相 ...
- web模拟终端博客系统
本文由QQ音乐前端团队发表 前段时间做了一个非常有意思的模拟终端的展示页:http://ursb.me/terminal/(没有做移动端适配,请在PC端访问),这个页面非常有意思,它可以作为个人博客系 ...
- pycharm专业版破解
网上找的用license server破解的地址都不可用== 有个方法倒是靠谱的,记录一下: 1.将C:\Windows\System32\drivers\etc里面的hosts文件打开,然后在文件中 ...
- 如何在 Linux 服务器上部署多个 Tomcat
开发管理项目时多多少少会遇到服务器不够用.一个项目分成多个子项目的情况,故研究了一下如何在一台服务器部署多个 Tomcat. 具体操作: 1.在 /tomcat/ 下部署多个 tomcat. 2.修改 ...
- FFmpeg封装格式处理4-转封装例程
本文为作者原创,转载请注明出处:https://www.cnblogs.com/leisure_chn/p/10506662.html FFmpeg封装格式处理相关内容分为如下几篇文章: [1]. F ...
- macOS 系统 .DS_Store 文件详解
.DS_Store 文件 .DS_Store 是 Finder 用来存储这个文件夹的显示属性的:比如文件图标的摆放位置. 显示/隐藏 Mac 隐藏文件 显示:defaults write com.ap ...