Facebook X (Twitter) Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook X (Twitter) Instagram
    TecAdmin
    You are at:Home»Linux Commands»How to Check System Reboot History in Linux

    How to Check System Reboot History in Linux

    By RahulMarch 2, 20233 Mins Read

    Checking the system reboot history is an important task for system administrators in Linux. Knowing when the system was last rebooted can help in troubleshooting issues and planning for maintenance tasks. One of the ways to check system reboot history in Linux is by using the last command.

    The last command displays a list of all system logins and logouts, including system reboots. By default, the last command displays the information in reverse chronological order, with the most recent events at the top of the output.

    Check Last Reboot History

    Mostly Linux/Unix systems provide the last command, which provides us the history of last logins and system reboots. These entries are keeps in the lastlog file. Run the last reboot command from the terminal, and you will get the details of the last reboots.

    last reboot 
    
    Output
    reboot system boot 5.4.0-80-generic Tue Feb 22 12:50 still running reboot system boot 5.4.0-80-generic Tue Feb 22 11:20 - 12:50 (01:30) reboot system boot 5.4.0-80-generic Mon Feb 21 14:32 - 11:20 (20:48)

    The output shows the date and time of each system reboot, along with the system message indicating the reason for the reboot. In the example above, the system was last rebooted on February 22nd at 12:50 and is still running.

    Customize the Output

    You can customize the output of the last command by using various options. For example, you can use the -n option to specify the number of lines to display, or the -F option to display the full date and time in the output.

    Here are some examples:

    last reboot -n 5    # Displays the last 5 system reboots
    last reboot -F       # Displays the full date and time in the output
    

    Check System Uptime

    Additionally, you can also use the uptime command to find the system uptime from last booted. Just open the terminal on your system and type uptime and hit enter.

    uptime  
    
    Output
    11:56:48 up 65 days, 5:42, 1 user, load average: 0.09, 0.11, 0.18

    As per above output, the system is running from 65 days, 5 hours and 42 minutes.

    Conclusion

    Checking system reboot history in Linux is an essential task for system administrators. The last command provides an easy way to check system reboot history by displaying a list of all system reboots in reverse chronological order. By interpreting the output of the last command, you can get a better understanding of your system’s uptime and availability.

    command last linux command reboot uptime
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How to Ignore SSL Certificate Check with Wget

    How to Ignore SSL Certificate Check with Curl

    echo Command in Linux with Practical Examples

    View 2 Comments

    2 Comments

    1. Daniel Kegley on October 4, 2019 12:55 pm

      look for roll over files /var/log/wtmp* and use last -f (filename).

      Reply
    2. Ghosh on July 30, 2019 7:10 pm

      this command isn’t working, I know that a server is restarted. but it is not showing up
      The output is

      wtmp begins Sun Jul 28 03:26:39 2019

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Difference Between Full Virtualization vs Paravirtualization
    • Virtualization vs. Containerization: A Comparative Analysis
    • Using .env Files in Django
    • Using .env File in FastAPI
    • Setting Up Email Notifications for Django Error Reporting
    Facebook X (Twitter) Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.