Linux Uptime Command With Usage Examples

The Linux Operating System is filled with several commands which any aspiring Linux expert or power user e.g. system admin must have a good grasp of. One of such commands is uptime and today, I’ll briefly discuss its purpose and syntax.

Uptime is a command that returns information about how long your system has been running together with the current time, number of users with running sessions, and the system load averages for the past 1, 5, and 15 minutes. It can also filter the information displayed at once depending on your specified options.

uptime uses a simple syntax:

# uptime [option]

Using Uptime

You can run the uptime command without any options like so:

# uptime

It will display an output similar to:

09:10:18 up 106 days, 32 min, 2 users, load average: 0.22, 0.41, 0.32

In order of appearance, the command displays the current time as the 1st entry, up means that the system is running and it is displayed next to the total time for which the system has been running, the user count (number of logged on users), and lastly, the system load averages.

What are system load averages? It is the average number of processes that are in a runnable or uninterruptable state. A process is in a runnable state when it is using the CPU or waiting to use the CPU; while a process is in an uninterruptable state when it is waiting for I/O access like waiting for a disk.

To know more about uptime, check out our article: Understand Linux Load Averages and Monitor Performance of Linux

Now let’s see some useful uptime command usage with examples.

Check Linux Server Uptime

You can filter uptime’s result to show only the running time of the system with the command:

# uptime -p

up 58 minutes

Check Linux Server Starting Time

Using option -s will display the date/time since when the system has been running.

# uptime -s

2019-05-31 11:49:17

Uptime Version & Help

As it is with most command line apps, you can display uptime’s version information and quick help page with the following command.

# uptime -h

Usage:
 uptime [options]

Options:
 -p, --pretty   show uptime in pretty format
 -h, --help     display this help and exit
 -s, --since    system up since
 -V, --version  output version information and exit

For more details see uptime(1).

Having gotten to this point in the article, you can now use uptime for your daily runs and you’ll determine its level of usefulness to you. If you have any doubts, here’s its man page.

Martins D. Okoi
Martins Divine Okoi is a graduate of Computer Science with a passion for Linux and the Open Source community. He works as a Graphic Designer, Web Developer, and programmer.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.