This brief tutorial shows students and new users how to use the uptime command in Ubuntu to tell how long a system has been running.
On Linux systems, including Ubuntu the uptime command gives a one-line display of how long a system has been running as well as logged in users, system loads and current time.
If you’re a student or new user looking for a Linux system to start learning on, the easiest place to start is Ubuntu Linux OS. It’s a great Linux operating system for beginners and folks looking for easier Linux distribution to use.
Ubuntu is an open-source Linux operating systems that runs on desktops, laptops, server and other devices.
Both Ubuntu and Windows systems allow you to be productive, easy to use, reliable and enable you to install and run thousands of programs from gaming to productivity suite software for individuals and businesses.
About uptime command:
The uptime command gives you a one-line display of how long a system has been running as well as who is logged in to the system, system loads for the past 1, 5 and 15 minutes and current time.
Syntax:
Syntax is the rule and format of how the uptime command can be used. These syntax options can be reordered, but a straight format must be followed.,.
Below is an example syntax of how to use the uptime command.
uptime [options]
Options:
The command line options are switches or flags that determined how the commands are executed or controlled. they modify the behavior of the commands. they are separated by spaces and followed after the commands.
Below are some options of the uptime command:
Options: | Replace Options: with the options to run with the uptime command |
-p, –pretty | Use the -p, –pretty option to show uptime in pretty format |
-s, –since | Use the -s, –since option display system up since [TIME] |
-h, –help | Display a help message and exit. |
-V, –version | output version information and exit |
The uptime command uses the /var/run/utmp file to display information about who is currently logged on.
It uses the /proc directory to display information about system processes.
Simply run the uptime command to invoke it.
For example, when you run uptime command, it shows similar line as shown below:
14:26:07 up 500 days, 1 user, load average: 0.17, 0.14, 0.13
Details:
- 14:26:07 : Current time of the system which translates to 2:26 PM
- up 500 days: System has been up for 500 days
- 1 user: 1 user is logged in to the system
- load average: system load average
The update command is simple but useful if you need quick information about how long a system has been running since the last reboot.
Conclusion:
This post shows you how to use the uptime command on Ubuntu to display brief information on how long a system has been running since the last reboot.
If you find any error above, please comment below to alert us.