1 [root@centos110 ~]# who
登陆用户名 终端设备 登陆到系统的时间
2 root :0 2018-10-03 09:56 (:0)
3 root pts/0 2018-10-03 09:56 (192.168.1.118)
6、last命令
作用:查看所有系统的登陆记录,格式为“last [参数]”。
本机的登陆信息以日志文件的形式保存在系统中,可以很容易进行修改。
千万不要单纯以该命令的输出信息而判断系统有无被恶意入侵!
[root@centos110 ~]# last
root pts/0 192.168.1.118 Wed Oct 3 09:56 still logged in
root :0 :0 Wed Oct 3 09:56 still logged in
reboot system boot 3.10.0-862.14.4. Wed Oct 3 09:29 - 14:18 (04:49)
reboot system boot 3.10.0-862.el7.x Wed Oct 3 09:14 - 14:18 (05:04)
root pts/3 192.168.1.118 Tue Oct 2 17:40 - 00:05 (06:25)
root pts/2 :0 Tue Oct 2 17:39 - 09:12 (15:32)
root pts/1 192.168.1.118 Tue Oct 2 16:54 - 19:37 (02:42)
root pts/0 192.168.1.118 Tue Oct 2 15:38 - 19:34 (03:55)
root pts/0 192.168.1.118 Tue Oct 2 12:05 - 15:38 (03:33)
root :0 :0 Tue Oct 2 12:04 - 09:12 (21:07)
reboot system boot 3.10.0-862.el7.x Tue Oct 2 11:56 - 14:18 (1+02:22)
7、history命令
作用:显示历史执行过的命令,格式为“history [-c]”。
默认显示出当前用户在本地计算机中执行过的最近1000条命令记录。
如果觉得1000不够用,可以自定义/etc/profile文件中的HISTSIZE变量值。
参数 -c : 清除所有的命令历史记录。
“!编码数字”:重复执行某一次的命令。
历史命令会被保存到用户家目录中的 .bash_history 隐藏文件中,可用cat命令查看。
8、sosreport 命令(记为sos-report)
作用:收集系统配置及架构信息并输出诊断文档,格式为sosreport。
[root@centos110 ~]# sosreport
sosreport (version 3.5)
This command will collect diagnostic and configuration information from
this CentOS Linux system and installed applications.
An archive containing the collected information will be generated in
/var/tmp/sos.cx0Fud and may be provided to a CentOS support
representative.
Any information provided to CentOS will be treated in accordance with
the published support policies at:
The generated archive may contain data considered sensitive and its
content should be reviewed by the originating organization before being
passed to any third party.
No changes will be made to system configuration.
Press ENTER to continue, or CTRL-C to quit. 此处单击回车键确认收集信息
Please enter your first initial and last name [centos110]:此处单击回车键确认主机编号
Please enter the case id that you are generating this report for []:此处单击回车键来确认主机编号
Setting up archive ...
Setting up plugins ...
Running plugins. Please wait ...
Running 97/97: yum...
Creating compressed archive...
Your sosreport has been generated and saved in:
/var/tmp/sosreport-centos110-20181003144212.tar.xz
The checksum is: fe27be034c15d8a9eba22b3e3e30f0cc
Please send this file to your support representative.