uptime command in Linux

This uptime command guide is a follow-up to my previous 90 Linux Commands frequently used by Linux Sysadmins article. As time allows, I will continue to publish articles on these 90 commands geared toward Linux sysadmins and power users. Let’s continue this series with the uptime command.

The uptime outputs the current time, system uptime, number of logged-in users and current load average. If an argument is included, it is used as the file to be read to discover how many users are logged in. If no argument is specified, then a system default is used.

Linux uptime

Syntax: uptime [options]

Here’s the output on a server I manage:

$ uptime
15:56:43 up 153 days, 4:12, 1 user, load average: 9.90, 9.80, 9.13

 

Linux uptime command examples

To print the current time, uptime, the number of logged-in users and other information, use:

uptime

To show only the amount of time the system has been booted for, use:

uptime --pretty

To print the date and time the system booted up, use:

uptime --since

To show uptime’s version information:

uptime --version

The above commands can also be shorted. For example:
-p, = –pretty show uptime in pretty format.
-h = –help display this help and exit.
-s = –since system up since.
-V = –version output version information and exit.

Related commands:

  • top – Find files or directories under the given directory tree recursively.
  • w – show a list of currently logged-in user sessions.
  • ps – information about the currently running processes.

 

Conclusion

The uptime command is worthwhile to be used post command-line login on local and remote systems to provide a fast overview of the current time, system uptime, number of logged-in users and current load average.

Tags: , ,

Stop losing users to slow load times.

Blazing-fast, custom-configured NVMe Linux hosting.

Don't guess if your server is fast enough. Know it. Get a free performance audit of your current setup.

This blog is hosted by StackLinux, our parent company. 99.99% uptime.

Start Your Free Server Audit

You write the code. We'll manage the server.

Fully managed Linux hosting built for absolute speed.

Ditch the server maintenance headaches. Our experts custom-configure high-performance NVMe Linux servers specifically for your needs. Try us out. Your first month is entirely on us.

This blog is hosted by StackLinux, our parent company. 99.99% uptime.

Claim Your 30 Free Days

30 days of NVMe Linux hosting. $0 down.

Risk-free migration and a money-back guarantee.

We are so confident in our high-performance NVMe infrastructure that we'll audit your current server for free, migrate you without downtime, and give you 30 days to see the speed difference yourself.

This blog is hosted by StackLinux, our parent company. 99.99% uptime.

Deploy Free for 30 Days
Top ↑