uptime command in linux

it active period The Commands Guide is a follow-up to my previous 90 Linux Commands Frequently Used by Linux Sysadmins article. As time goes on, I will continue to publish articles on these 90 commands designed for Linux sysadmins and power users. let’s continue this series uptime Permission.

Uptime Outputs the current time, system uptime, number of logged-in users, and the current load average. If an argument is included, it is used to read as a file to find out how many users are logged in. If no arguments are specified, the system default is used.

syntax: uptime [options]

Here’s the output on the server I’m managing:

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

Linux uptime command example

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

uptime

To show how long the system has been booted for, use:

uptime --pretty

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

uptime --since

To show version information for uptime:

uptime --version

The above commands can also be shortened. for example:
-P= -Beautiful show uptime in beautiful format.
-h = -help Display this help and exit.
-s = – Since System.
-V = -version Output version information and exit.

Related orders:

  • top – recursively search for files or directories under the given directory tree.
  • W – Show a list of currently logged-in user sessions.
  • PS – Information about currently running processes.

conclusion

uptime The command is suitable for using 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 averages.

Leave a Comment