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.
The uptime command in Ubuntu Linux displays how long a system has been running since the last reboot. It also shows other information, such as the number of logged-in users, system loads, and the current time.
This command is useful for system administrators who need to monitor the performance of their servers and ensure that they are running smoothly. Additionally, the uptime command can be used to troubleshoot system performance issues and identify potential bottlenecks.
Overall, the uptime command is a simple yet powerful tool that provides quick information about the uptime and performance of a Linux system.
About uptime command:
The uptime command gives you a one-line display of how long a system has been running, who is logged in to the system, the system loads for the past 1, 5, and 15 minutes, and the current time.
Syntax:
The 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 determine 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 for 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 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 the uptime command, it shows a 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: The 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 run 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.
Leave a Reply Cancel reply