linux, macos, windows,

Check system uptime in Linux MacOS and Windows from the Command Line

Mar 23, 2022 · 1 min read · Post a comment
Check system uptime in Linux MacOS and Windows from the Command Line

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

Example output:

11:37  up  3:22, 4 users, load averages: 2.23 2.38 2.24

Option 2. The w command.

w

Example 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

Example 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"

Example output:

System Boot Time: 3/23/2022, 08:26:40 AM

Option 2. Use a more modern approach e.g. PowerShell.

Get-Uptime -Since

Example 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.