uptime: Display how long the current system session has been running
August 9th, 2024 1:15 PM Mr. Q Categories: Command
Command: uptime
The uptime
command shows how long the system has been running since the last reboot, along with the current time, the number of users logged in, and the system’s load averages.
Sample Commands and Outputs:
uptime
: Displays the system’s uptime, current time, number of users, and load averages. Sample Command and Output:
Copy001 $ uptime
002 12:00:01 up 1 day, 3:45, 2 users, load average: 0.15, 0.22, 0.18
Description:
12:00:01
: The current time.up 1 day, 3:45
: The system has been running for 1 day and 3 hours 45 minutes.2 users
: The number of users currently logged in.load average: 0.15, 0.22, 0.18
: The system load averages over the last 1, 5, and 15 minutes.uptime -p
: Displays the uptime in a “pretty” format. Sample Command and Output:
Copy001 $ uptime -p
002 up for 1 day, 3 hours, 45 minutes
Description:
-p
: The option to show the uptime in a more human-readable format.uptime -s
: Displays the system’s start time in ISO 8601 format. Sample Command and Output:
Copy001 $ uptime -s
002 2024-08-08 08:15:32
Description:
-s
: The option to show the time when the system was last started.uptime -f
: Shows the full format including the system’s uptime, the number of users, and the load averages in a detailed manner. Sample Command and Output:
Copy001 $ uptime -f
002 12:00:01 up 1 day, 3 hours, 45 minutes, 2 users, load average: 0.15, 0.22, 0.18
Description:
-f
: The option to provide a more detailed output, including the full format of the uptime, number of users, and load averages.uptime -h
: Displays help information for theuptime
command. Sample Command and Output:
Copy001 $ uptime -h
002 Usage: uptime [OPTION...]
003 Show how long the system has been running.
004
005 -p, --pretty show uptime in a human-readable format
006 -s, --since show system start time
007 -f, --full show full format
008 -h, --help display this help message
Description:
-h
: The option to display help information, showing the available options and usage of theuptime
command.
Note: The uptime
command is essential for monitoring system performance and stability. The -h
option is particularly useful for getting a quick reference on how to use the command and its available options.