查看历史操作
- history 10(列出最近的 10 条操作)
- !105(重复执行第 105 条命令)
- !!(重复执行上一条命令)
- !last(执行最后一次以 last 开头的命令)
- history | more(逐条列出历史指令)
- history -c(清空所有的历史指令)
日志
/var/log/message 系统启动后的信息和错误日志, 是 Red Hat Linux 中最常用的日志之一
/var/log/secure 与安全相关的日志信息
/var/log/maillog 与邮件相关的日志信息
/var/log/cron 与定时任务相关的日志信息
/var/log/spooler 与 UUCP 和 news 设备相关的日志信息
/var/log/boot.log 守护进程启动和停止相关的日志消息
- uname -a # 查看内核 / 操作系统 / CPU 信息
- [root@MoKin ~]# cat -n /etc/issue
- 1 \S
- 2 Kernel \r on an \m
- 3
- [root@MoKin ~]# cat -b /etc/issue
- 1 \S
- 2 Kernel \r on an \m
cat -n 和 cat -b 的区别在于:-b: 列出行号, 仅针对非空白行做行号显示, 空白行不标行号;-n: 列印出行号, 连同空白行也会有行号, 与 -b 的选项不同;
查看 CentOS 的版本:
- [root@MoKin etc]# cat *-release
- CentOS Linux release 7.5.1804 (Core)
- NAME="CentOS Linux"
- VERSION="7 (Core)"
- ID="centos"
- ID_LIKE="rhel fedora"
- VERSION_ID="7"
- PRETTY_NAME="CentOS Linux 7 (Core)"
- ANSI_COLOR="0;31"
- CPE_NAME="cpe:/o:centos:centos:7"
- HOME_URL="https://www.centos.org/"
- BUG_REPORT_URL="https://bugs.centos.org/"
- CENTOS_MANTISBT_PROJECT="CentOS-7"
- CENTOS_MANTISBT_PROJECT_VERSION="7"
- REDHAT_SUPPORT_PRODUCT="centos"
- REDHAT_SUPPORT_PRODUCT_VERSION="7"
- CentOS Linux release 7.5.1804 (Core)
- CentOS Linux release 7.5.1804 (Core)
来源: http://www.bubuko.com/infodetail-2736220.html