In this article we are going to shows how to use uptime command in Linux. If you want to learn about uptime command in Linux with Examples then this post is ideal for you.
In the Linux, uptime is a command that is used to display the information about how long the system has been running(active). It is also help you to shows the current time, the number of currently logged-in users and system load averages for the past 1, 5, and 15 minutes respectively.
Linux is an operating system, similar like Windows OS, iOS, and Mac OS. Linux is one of the most popular operating system on the planet, Android is also powered by Linux OS(operating system).
Linux OS(operating system) is also distributed under an open source license. Open source following these points :
- Freely to run the program, for any purpose.
- Free to study how the program works.
- Freely to re-distribute copies so you can help your friends.
- Free to distribute copies of your modified versions to others.
How to use Uptime Command in Linux
In the Linux, the basic syntax of the uptime command is show as below:
uptime [OPTIONS]
When you run the uptime command without any option and argument, it will just display the system uptime:
uptime
Output
10:19:26 up 4 min, 0 users, load average: 0.04, 0.03, 0.01
Here:
- 10:19:26 – Current system time
- up 4 min – System Uptime
- 0 users – Number of logged-in users
- load average: 0.04, 0.03, 0.01 – System load averages for the past 1, 5, and 15 minutes respectively.
Uptime options
Run the following command below to display the options available for uptime command:
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).
Use the -p
, --pretty
option with uptime
command to display the output in a pretty format( human-readable format):
uptime -p
Output
up 31 minutes
Use the -s
, --since
option to display the date and time(starting time) since the system is up:
uptime -s
Output
2021-04-19 10:14:39
If you want to display the output version information and exit then use the -V, –version option with uptime command:
uptime -V
Output
uptime from procps-ng 3.3.10
That’s all
If you face any error and issue in above steps , please use comment box below to report.
If our tutorials helped you, please consider buying us a coffee. We appreciate your support!
Thank you for your support.