How to view system log files in CentOS?
To view the system log files, you can use the following command:
- Viewing system log files:
cat /var/log/messages
- View the starting log file:
cat /var/log/boot.log
- View the security log files.
cat /var/log/secure
- View the kernel log file:
dmesg | less
- View the log files for a specific service (using the sshd service as an example):
cat /var/log/secure | grep sshd
The above commands can be used to view various log files in the system, assisting in troubleshooting system issues and understanding the system’s operation status.