Linux Uptime Command with Examples

The uptime command displays how long the system has been up (running) along with the current time, number of logged-in users, and the system load averages for the past 1, 5, and 15 minutes.

In this tutorial, we learn the Linux uptime command.

How to use Uptime

The syntax for uptime:

uptime [OPTIONS]

The uptime options are -p, -s, -h, and -v.

To find a server uptime simply type:

$ uptime

Output:

05:51:23 up 366 days, 11:48,  1 user,  load average: 0.07, 0.08, 0.03
  • 05:51:23 - Current time.
  • up 366 days, 11:48 - How long the system has been up (running). Shows in hours and after 24 hours shows days.
  • 1 user - Number of logged-in users in the system.
  • load average: 0.07, 0.08, 0.03 - The system load averages for the past 1, 5, and 15 minutes.

Display Linux Uptime in pretty format

To display how long the system has been running in a much pretty format, use -p option.

$ uptime -p

Output:

up 1 year, 2 days, 13 hours, 48 minutes

The system is running for 1 Year, 2 days, and 13 hours.

Display the time/date since when the system has been running

To display the date and time since the system is running, use the -s option.

$ uptime -s

Output:

2020-10-16 18:02:32

Display Uptime Version information and Help page

You can display uptime version and help using the following commands

$ uptime -h
$ uptime -V
uptime version & help page

Conclusion

In this tutorial, we covered the uptime command in Linux. Mostly used command to find how long the system has been on. You can also check /proc/uptime file - The first value shows the total number of seconds the system has been running.

Leave a Comment