To obtain the log of shutdown events in Linux, you can check the system logs. The specific log file and its location may vary depending on the Linux distribution you are using. Here are a few common locations:

  1. /var/log/messages or /var/log/syslog: These files contain general system messages, including shutdown events. You can view these logs using the cat or less command:

    cat /var/log/messages
    
  2. /var/log/kern.log: This file logs kernel-related events, including shutdowns. You can view the log with the cat or less command:

    cat /var/log/kern.log
    
  3. /var/log/lastlog: This log file provides information about the last login session, including the shutdown time. You can view it using the last command:

    last -x
    
  4. /var/log/wtmp or /var/log/utmp: These files record user login and logout information, including shutdown events. You can use the last command to view this log as well:

    last -x
    

Remember that you may need root or sudo privileges to access some of these log files. Additionally, the log files may rotate or be compressed, so you might need to use tools like zcat, gzip, or journalctl depending on your system configuration

how can i get the log of shutdown of linux

原文地址: http://www.cveoy.top/t/topic/hQn1 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录