Using the uptime command on a Raspberry Pi

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.

By default, the uptime command is already installed on Raspberry Pi OS. We can check version as follows to make certain of this:

uptime --version

You can now run the uptime command without any parameters in order to check the uptime of Raspberry Pi:

uptime

The output will be similar to this:

user@raspberrypi:~ $ uptime
11:48:15 up 19 min, 2 users, load average: 0.14, 0.18, 0.20

11:48:15 – the current time.
up 19 min  – how long the Raspberry Pi has been running.
2 users – the number of currently logged on users.
load average: 0.14, 0.18, 0.20 – the average system load for the past 1, 5, and 15 minutes.

We can use -p option to print the uptime in human-readable format:

uptime -p

Example of the output:

up 4 hours, 15 minutes

We can also use -s option to get the date and time since the Raspberry Pi started to run.

uptime -s

Example of the output:

2023-09-22 07:32:33

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

Related posts

Using hwinfo Command on aRaspberry Pi

Getting CPU info using cpufetch on Raspberry Pi

Use lshw to get hardware information about a Raspberry Pi

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Read More