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 ...
随机推荐
- docker容器中Postgresql 数据库备份
查看运行的容器: docker ps 进入目标容器: docker exec -u root -it 容器名 /bin/bash docker 中,以root用户,创建备份目录,直接执行如下命令, p ...
- django--form相关
简单用法: Django提供 Form组件: 1. 定义规则 from django.forms import Form ...
- Linux_CentOS-服务器搭建 <三> 补充
今天 才发现,服务器上 JDK 都没有好好的安装下.在这里补充说下. 1.看看机子上JDK的安装了多少 $ rpm -qa |grep java 会出现类似: java-1.6.0-openjdk-1 ...
- [深度学习] 最全优化方法总结比较--SGD,Adagrad,Adadelta,Adam,Adamax,Nadam
SGD 此处的SGD指mini-batch gradient descent,关于batch gradient descent, stochastic gradient descent, 以及 min ...
- java 判断两个时间段是否有交集
/* 开始时间 */ Date leftStartDate = feesPreferential.getPreferentialStartTime(); /* 结束时间 */ Date leftEnd ...
- OpenCV设置保存图像压缩率
OpenCV写入静态图片时,imwrite函数第三个参数可以设置压缩率,默认值为95. cv::Mat inImage= cv::imread("lena.jpg"); vecto ...
- asp.net 获取网站根地址
public static string GetSiteRoot() { string port = System.Web.HttpContext.Current.Request.ServerVari ...
- 因 URL 意外地以“/HelloWorld”结束,请求格式无法识别。
WebService中发布之后出现这个错误, 解决方法: web.config文件中的 <system.web> 节点下加入:<webServices> <prot ...
- ASP .NET MVC HtmlHelper扩展——简化“列表控件”的绑定
在众多表单元素中,有一类<select>元素用于绑定一组预定义列表.传统的ASP.NET Web Form中,它对应着一组重要的控件类型,即ListControl,我们经常用到DropDo ...
- js 去掉缓存的几种方式
1.在Ajax发送请求前加上 anyAjaxObj.setRequestHeader ("If-Modified-Since","0") 2.在Ajax发送请求 ...