# 查看CentOS版本rpm -q centos-release# 重启shutdown -r now# 关机shutdown -h now# 查看默认防火墙状态(关闭后显示notrunning,开启后显示running)firewall-cmd --state# 硬盘使用情况df -lh# 内存使用情况free -mht# 查找内容大于100M的文件ls -lh $(find / -type f -size +100M)# 查看某个目录的文件大小并排序(单位为MB)du -hm --max-depth=1 /var/ | sort -n# 查看文件大小du -t 100M /var 或 journalctl --disk-usage# 清理journalctl --vacuum-size=10M# 检查服务运行情况ps -ef | grep xxx-# 检查防火墙状态firewall-cmd --state# 查看端口占用情况netstat -lnp | grep 1999
