Linux get uptime с

Linux Server Uptime Command To Find Out How Long The System Has Been Running

Linux Server Uptime Command

Open a command-line terminal (select Applications > Accessories > Terminal), and then type the following command:
$ uptime
Sample outputs:

The uptime command gives a one line display of the following information.

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard

Join Patreon

  • The current time (21:54:11)
  • How long the system has been running (up 13 days)
  • How many users are currently logged on (1 user)
  • The system load averages for the past 1, 5, and 15 minutes (0.21, 0.21, 0.12)

See uptime in pretty format pass the -p option to the uptime command

$ uptime -p
Sample outputs:

This is the same information contained in the header line displayed by the w command and top command:
$ w
Sample outputs:

Getting help about uptime command

To check system uptime in Linux and Unix we use the uptime command. However, if you need more information on command option type the following man command:
$ man uptime
OR
$ uptime —help
Sample outputs:

Use top command to display Linux system uptime

Type the following command:
$ top
Sample outputs:

Fig.01: UNIX uptime top command output

Conclusion

In this quick tutorial, you learned how to use uptime, w, and top commands to see system uptime and other information from the command line.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via

Category List of Unix and Linux commands
Documentation help • mandb • man • pinfo
Disk space analyzers df • duf • ncdu • pydf
File Management cat • cp • less • mkdir • more • tree
Firewall Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04
Linux Desktop Apps Skype • Spotify • VLC 3
Modern utilities bat • exa
Network Utilities NetHogs • dig • host • ip • nmap
OpenVPN CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04
Package Manager apk • apt
Processes Management bg • chroot • cron • disown • fg • glances • gtop • jobs • killall • kill • pidof • pstree • pwdx • time • vtop
Searching ag • grep • whereis • which
Shell builtins compgen • echo • printf
Text processing cut • rev
User Information groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w
WireGuard VPN Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04

Comments on this entry are closed.

my favorite 🙂 updates every second….

Nice looking site; useful and clear information. Good job!

The only problem with the uptime command is that it isn’t always obvious what units of measure to the time it has been up. Just a bit confusing for those new to it, especially those from the Windoze world trying to come over to Linux. Just fleshing out the units (up 5 hours:54 minutes (days:hours:minutes)) on this would certainly help in bringing more over, especially if we can get into the man&info pages.

$ uptime
07:55:56 up 3 days, 17:37, 6 users, load average: 0.04, 0.06, 0.01
$

by default it will give how many days the OS is up, and how many hours:mins.
if it less than 1 day, it will give only hours:mins.

what is the command for checking how many bites are already downloaded in your server

How do I get only time information excluding other load information

How do I get only time information excluding other load information

# 1. run Command
# 2. strip unneeded leading data
# 3. check if the uptime is greater than 24 hours
# 4. make the output human readable
# 5. trim any leading space

For people who want to get uptime within a C program I would suggest having a look at sysinfo() too…

nice and so useful
thank you

How can i know uptime of a server machine without logging in it ?? Is there any way?

Hello Buddies , plz specify whats the value ‘4:29’ in the above output.

@Kunal It’s 4 hours and 29mins. So from the output the server uptime is 13 days, 4 hours and 31 mins.

thanks for this!

Did you see the output within one hour of startup? Is it, e.g. 0:15, :15 or 15 for the 15 minutes after startup?

On most systems you can do cat /proc/uptime if you’re only interested in the uptime. The first number is how many seconds the system has been up for, and the second number is how many seconds it’s spent idle.

Tuptime is a uptime with steroids, nice tool for getting uptime, downtime and other interesting stuff:
https://github.com/rfrail3/tuptime

How can i see the only up time without any other information is there Any command to know only the Uptime i mean to say the if i issue a command it should print 21:54:11 up 13 days, 4:29

Источник

How do you find the uptime of a Linux server?

I am a new Linux system user. I need to find the uptime of a Linux server located in AWS cloud. How do I check Linux system uptime?

Linux command ship with various command line tools to find out server uptime command. File /proc/uptime has uptime information, and file /var/run/utmp has information about who is currently logged on. However, data from /proc/uptime or /var/run/utmp file is not directly readable by humans, so you need to use the following commands.

Tutorial details
Difficulty level Easy
Root privileges No
Requirements Linux terminal
Est. reading time 2 minutes

Command to find the uptime of a Linux server

To find the uptime of a Linux server use any one of the following command. First, open the terminal window and then type:

  1. uptime command – Tell how long the Linux system has been running
  2. w command – Show who is logged on and what they are doing including the uptime of a Linux box
  3. top command – Display Linux server processes and display system Uptime in Linux too.

Let us see examples.

How to check system uptime in Linux

Open the terminal application on Linux and type the following uptime command:
uptime

My Linux system is running from last 13 days

Show uptime in pretty and human readable format by passing the -p as follows:
uptime -p
Sample outputs:

Want to find out the system is up since what time?

Try passing the -s as follows to see information in yyyy-mm-dd HH:MM:SS format:
uptime -s
Sample outputs:

Check Linux system uptime with w command

Run the w command to show information about the users currently on the Linux machine, and their processes. The header shows, in this order, the current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes. For example, type the following w command:
w

Display server uptime in Linux using top command

The top command provides a dynamic real-time view of a running system. It can display system summary information as well as a list of processes including system uptime. Open the terminal and run:
top

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard

Join Patreon

Conclusion

You learned how to use the uptime command that display the current time, the length of time the Linux system has been up, the number of users online, and the load average. For more information, see this page and the following pages using the man command:
man uptime
man w
Also see:

  • Linux Server see the historical and statistical uptime of system with tuptime utility

🐧 Get the latest tutorials on Linux, Open Source & DevOps via

Источник

linux-notes.org

Как узнать uptime в Linux/Unix

Нужно проверить uptime сервера? Нужно узнать когда был последний reboot ( перезагрузка)? Не знаете как? Я расскажу вам как можно проверить uptime вашей ОС (Linux\Unix), приведу в своей статье «Как узнать uptime в Linux/Unix» 3 способа как это можно сделать.

1. Команда top.

Top — программа для слежения за активностью процессора в реальном времени. Он отображает список наиболее ресурсоемких задач в системе и может обеспечить интерактивный интерфейс для управления процессами. Программа может сортировать задачи по загрузке процессора, использование памяти и времени автономной работы. Так же есть улучшенная версия под названием htop, которая дает возможность пролистывать и смотреть каждый процесс. Так же данная программа может показать время последней перезагрузки (uptime), чтобы посмотреть это, выполните:

посмотреть uptime с помощью утилиты top

2. Команда w.

Команда (утилита) w — отображает информацию о пользователях которые в настоящее время есть на машине, и их процессов. Внутри заголовка, показывается текущее время, как долго система работает, сколько пользователей в настоящее время вошли в систему, и среднюю нагрузку системы за последние 1, 5 и 15 минут

посмотреть uptime с помощью утилиты w

3. Команда uptime.

uptime дает одно строчную информацию на экран. Он показывает текущее время, как долго система работает уже, сколько пользователей в настоящее время залогинились в системе и среднюю нагрузку системы за последние 1, 5 и 15 минут.

посмотреть uptime с помощью утилиты uptime

Моя тема «Как узнать uptime в Linux/Unix» завершена. Спасибо за посещение моего сайта http://linux-notes.org

Добавить комментарий Отменить ответ

Этот сайт использует Akismet для борьбы со спамом. Узнайте, как обрабатываются ваши данные комментариев.

Источник

Linux Uptime Command With Usage Examples

The Linux Operating System is filled with several commands which any aspiring Linux expert or power user e.g. system admin must have a good grasp of. One of such commands is uptime and today, I’ll briefly discuss its purpose and syntax.

Uptime is a command that returns information about how long your system has been running together with the current time, number of users with running sessions, and the system load averages for the past 1, 5, and 15 minutes. It can also filter the information displayed at once depending on your specified options.

uptime uses a simple syntax:

Using Uptime

You can run the uptime command without any options like so:

It will display an output similar to:

In order of appearance, the command displays the current time as the 1st entry, up means that the system is running and it is displayed next to the total time for which the system has been running, the user count (number of logged on users), and lastly, the system load averages.

What are system load averages? It is the average number of processes that are in a runnable or uninterruptable state. A process is in a runnable state when it is using the CPU or waiting to use the CPU; while a process is in an uninterruptable state when it is waiting for I/O access like waiting for a disk.

To know more about uptime, check out our article: Understand Linux Load Averages and Monitor Performance of Linux

Now let’s see some useful uptime command usage with examples.

Check Linux Server Uptime

You can filter uptime’s result to show only the running time of the system with the command:

Check Linux Server Starting Time

Using option -s will display the date/time since when the system has been running.

Uptime Version & Help

As it is with most command line apps, you can display uptime’s version information and quick help page with the following command.

Having gotten to this point in the article, you can now use uptime for your daily runs and you’ll determine its level of usefulness to you. If you have any doubts, here’s its man page.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

We are thankful for your never ending support.

Источник

Читайте также:  Windows internet explorer facebook
Оцените статью