• Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate
TecNStuff
Menu
  • Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate

Uptime Command in Linux With Example

Written by Admin, Updated On June 12, 2019
linux commands, terminal, uptime
Linux Uptime Command

The uptime command is used to show how long the system has been running. It will also show currently logged in users, system load average and the current time. In this tutorial, we have described the use of uptime in detail.

Uptime Command Syntax#

The syntax for the uptime command is as follows:

uptime [OPTIONS]

Where, you can pass arguments to view in different format using options.

How to use the uptime command#

To just display the uptime without any option run below command:

uptime

It will print output as following:

Output
04:26:09 up 15 day, 1:21, 1 user, load average: 0.16, 0.03, 0.01
  • 04:26:09 is the current system time.
  • up 15 days, 1:21 is the length of time the system has been up.
  • 1 user is the number of logged in users.
  • load average: 0.16, 0.03, 0.01 are system load averages for the past 1, 5, and 15 minutes.

System load averages is the average number of processes that are currently running or waiting for disk I/O. A process in a runnable state is either using the CPU or waiting to use the CPU.

The averages are taken over the three time intervals. Load averages are not normalized for the number of CPUs in a system, so a load average of 1 means a single CPU system is loaded all the time while on a 4 CPU system it means it was idle 75% of the time.

Uptime Command Options#

Following are the options for uptime commands:

  • -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

The -p, --pretty option will show uptime output in a pretty format:

uptime -p

It will print only how long the system has been running:

Output
up 1 day, 1 hour, 29 minutes

The -s, --since option shows the date and time since the system is up:

uptime -s
Output
2019-06-11 03:04:52

Option -h will show the general help as below:

uptime -h
Output
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).

Last option uptime -V will print the version information.

uptime -V
Output
uptime from procps-ng 3.3.12

Conclusion#

As you see, the uptime command is easy to understand and use. It gives you information about current logged in users, current time and how long your system has been running and the average system load.

If you have any question, leave a comment below.

If our content helps you, please consider buying us a coffee

Thank you for your support.

Share On
Share on Facebook
Share on Twitter
Share on Reddit
Share on Tumblr
 Previous Article Chown Command in Linux
Next Article   Linux File Command With Example

Related Posts

  • How to Install SSH Keys on Ubuntu 22.04

    How to Set up SSH Keys on Ubuntu 22.04

    January 7, 2023
  • How to Install Fail2ban on Ubuntu 22.04

    How to Install and Configure Fail2ban on Ubuntu 22.04

    December 5, 2022
  • How to Enable SSH on Ubuntu 22.04

    How to Enable SSH on Ubuntu 22.04

    December 1, 2022

Leave a Reply Cancel reply

DigitalOcean Referral Badge

Popular Posts

  • How to Install Microsoft Edge Browser on Ubuntu 22.04
    How to Install Microsoft Edge Browser on Ubuntu 22.04 March 14, 2023
  • How to Install Ruby on Ubuntu 22.04 LTS
    How to Install Ruby on Ubuntu 22.04 LTS February 27, 2023
  • How to Install LEMP Stack on Ubuntu 22.04
    How to Install LEMP Stack on Ubuntu 22.04 March 18, 2023
  • How to Install Set Up Apache Virtual Hosts on Ubuntu 22.04
    How to Set Up Apache Virtual Hosts on Ubuntu 22.04 March 2, 2023
  • How to Install MariaDB on Debian 11 Bullseye
    How to Install MariaDB on Debian 11 Bullseye March 8, 2023
© 2020 TecNStuff All rights reserved. This website is using and storing cookies on your browser. By using this website you agree our Privacy Policy.  Follow us -  Twitter | Facebook