uptime Command in Linux

Learn via video courses
Topics Covered

Overview

The uptime command is a handy utility tool that provides information about how long a Linux system has been running, the number of users logged in, and the current system load average. This information is useful for system administrators to monitor server uptime and detect any issues or trends in system usage. In this article, we will explore the syntax, usage, and advanced usages of the uptime command in Linux.

Transform Your Career

Choose from our industry-leading programs designed for career success

NSDC Certified

Modern Software and AI Engineering Program

Master full-stack development with AI integration

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Modern Data Science and ML with specialisation in AI

Advanced data science techniques with AI specialization

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Advanced AIML with Specialisation in Agentic AI

Deep dive into AIML with focus on Agentic systems

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

DevOps, Cloud & AI Platform Engineering

Build and manage AI-powered cloud infrastructure

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

AI Engineering Advanced Certification by IIT-Roorkee

Premier AI engineering certification from IIT-Roorkee

3 MonthsDuration
AI-LedCurriculum
Career SupportSupport
Program highlights
Go to Program

Linux uptime Command Syntax

The syntax for the uptime command is as follows:

Where:

  • $ uptime: The main command that is used to display system uptime information.

uptime Command Options:

Example Usages

  • Display system uptime information.:

    Output:

    Explanation: This command displays the current system time, how long the system has been running, the number of users logged in, and the current system load average.

  • Display system uptime in a more human-readable format.:

    Output:

    Explanation: This command displays system uptime in a more human-readable format, showing the number of days, hours, and minutes the system has been running.

  • Display the uptime of a remote server.:

    Output:

    Explanation: This command allows you to view the uptime of a remote server by SSH-ing into the server and running the uptime command.

Turn Learning into Career Growth

1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary
1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary

Tips

  • You can use the uptime command in combination with other Linux commands like top or ps to monitor system resource usage.

  • The load average displayed by the uptime command indicates the average number of processes running on the system over the last 1, 5, and 15 minutes.

Advanced Use Cases of uptime Command in Linux

  • Display the last time the system was booted.:

    Output:

    Explanation: This command displays the last time the system was booted.

  • Display the system uptime and date the system was last booted.:

    Output:

    Explanation: This command displays the system uptime and the date the system was last booted.

  • Display the average system load over a specified time interval.:

    Output:

    Explanation: This command displays system uptime and load average, along with additional information about the logged-in users and their activities.

Conclusion

  • The uptime command is a handy tool to monitor server uptime and detect system issues.

  • It can be used in combination with other commands to monitor system resource usage and analyze system performance.

  • The load average displayed by the uptime command provides information about the average number of processes running on the system over a specified time interval.

  • The uptime command also allows you to view the last time the system was booted and the date of the last boot.

Hiring Partners:
GoogleGoogleAmazonAmazonMicrosoftMicrosoftFlipkartFlipkartAdobeAdobe1200+ more