How to view shutdown logs in Linux operating system?
You can check the shutdown logs in the /var/log directory on a Linux system. The specific steps are as follows:
- Open the terminal.
- Enter the following command to view the shutdown log file: sudo cat /var/log/syslog
- Quickly scroll to the end of the file by using the Ctrl + End keys, or navigate through the log file page by page using the Page Down key.
- Record of the shutdown process can be found based on the timestamp, usually including information such as “systemd-shutdown[1]: Sending SIGTERM to remaining processes…” and “systemd-shutdown[1]: Waiting for process:…”.
- Exit viewing by pressing the Ctrl + C keys.
Please note that if the /var/log/syslog file is too large, you can use other commands like grep or less to filter and view the shutdown logs. For example, you can use the following command to filter shutdown logs: sudo grep “shutdown” /var/log/syslog.