The following commands will help you find the system uptime for Linux, macOS and Windows in the easiest way possible, from the command line.
Prerequisites
- Shell environment
Linux and macOS
A few options available to check the system uptime, including:
Option 1. The uptime
command.
uptime
Output:
11:37 up 3:22, 4 users, load averages: 2.23 2.38 2.24
Option 2. The w
command.
w
Output:
10:38:37 up 12 days, 8:14, 1 user, load average: 0.03, 0.02, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
devcoops pts/0 <IP_ADDRESS> 10:37 0.00s 0.13s 0.04s sshd: devcoops [priv]
Option 3. The top
command.
top
Output:
top - 10:39:43 up 12 days, 8:15, 1 user, load average: 0.01, 0.01, 0.00
...
Windows
Option 1. Open Command Prompt and run the following command:
systeminfo | find "System Boot Time"
Output:
System Boot Time: 3/23/2022, 08:26:40 AM
Option 2. Use a more modern approach e.g. PowerShell.
Get-Uptime -Since
Output:
Wednesday, March 23, 2022 08:26:40 AM
Conclusion
If you can think of any other alternative way, please do let me know in the comment section below. On a side note, follow our official channel on Telegram.