Jump to content

Check Uptime on Ubuntu


Linux Hint

Recommended Posts

Any Linux distro comes with the uptime command. As the name suggests, this tool reports how long the system has been running. It’s an important command for system administrators to know. It helps troubleshooting issues related to power and scheduling. Of course, there are other alternative tools available for this purpose but uptime is relatively simple and easy-to-use.

In this guide, check out how to check uptime on Ubuntu.

Uptime on Ubuntu

On any UNIX-like system, the uptime command will come pre-installed. That applies to Ubuntu as well. Verify the existence of the tool by running these commands.

$ which uptime

word-image-218.png

$ uptime --version

word-image-219.png

Check system uptime

To check the system uptime, run the following command.

$ uptime

word-image-220.png

The output is quite self-explanatory. The only confusing part would be the load average one. Here’s what it means (according to the uptime man page).

Human-readable output

For humans like us, wouldn’t a nicer output be appreciated? That’s what the “pretty” format does. Uptime offers the output in a human-readable format. Use the “-p” or “–pretty” flag.

$ uptime -p

word-image-221.png

$ uptime --pretty

word-image-222.png

Date and time since when the system is up

In some situations, the system may be up and running for days. If that’s the case, then we can tell uptime to report since when the system is running. Use the “-s” or “–since” flag.

$ uptime -s

word-image-223.png

$ uptime --since

word-image-224.png

Uptime help

The uptime tool doesn’t come with that much option. If you need help with uptime, it’s always a good idea to check out the help page.

$ uptime -h

word-image-225.png

For in-depth information, the man page is more appropriate.

$ man uptime

word-image-226.png

Bonus method

This one isn’t related to the uptime command but it still offers information about the system reboot history.

$ last reboot

word-image-227.png

Final thoughts

The uptime tool is quite simplistic. There’s not much to the tool. However, the information it provides helps a lot when troubleshooting.

Uptime isn’t the only tool Linux comes with. Interested in more fun stuff? Check out the 25 basic Linux commands that every Linux user should know.

Happy computing!

View the full article

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...