/var/log/syslog、/var/log/messages/var/log/httpd/、/var/log/tomcat/ 或应用自定义目录cat:查看完整日志(适合小文件)。tail -f:实时查看最新日志(如 tail -f /var/log/httpd/access.log)。grep:过滤关键字(如 grep "404" /var/log/httpd/access.log)。less:分页查看(支持搜索,如 less /var/log/syslog)。awk/sort/uniq 统计IP访问量、错误频率等(如 awk '{print $1}' access.log | sort | uniq -c)。grep "2025-09-14 10:" /var/log/tomcat/catalina.out)。gnome-system-log(系统日志查看)、goaccess(Web日志分析)。logrotate 定期压缩归档日志,避免文件过大(配置文件:/etc/logrotate.d/)。参考来源: