Filters
Zo zoek je
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • "twee woorden" vindt precies die zin.
  • --naam of -x vindt een optie.
  • #woord zoekt alleen in commando's.
  • @grep vindt lessen en labs die grep gebruiken.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Zet ! voor een woord om het weg te laten. OR tussen woorden betekent één ervan.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken

uptime

Show how long the system runs, how many users are logged in and the load average.

Niveau
Dagelijks Linux
Groep
Processen en jobs
Root nodig
Nee
Pakket
procps-ng

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

Wat het doet

The load average is the number of processes that run or wait (for CPU or disk), as an average over 1, 5 and 15 minutes. Compare it with the number of CPU cores (nproc): a load of 4 on 2 cores means processes wait.

Zo schrijf je het

uptime [OPTION]...

Opties 4

Meest gebruikt

-p, --pretty
Only the run time, in words.
-s, --since
The date and time of the boot.
-h, --help
Show help.
-V, --version
Show the version.

Voorbeelden 10

$ als gewone gebruiker# als root (of met sudo)

  1. 1Default output

    uptime
     10:52:01 up  2:54,  2 users,  load average: 0.15, 0.10, 0.09

    Time, run time, users, load 1/5/15 minutes.

  2. 2Run time in words

    uptime -p
    up 2 hours, 54 minutes

    Easy to read.

  3. 3Boot time

    uptime -s
    2026-10-25 07:58:12

    Did the server reboot in the night?

  4. 4Load per core

    echo "$(cut -d' ' -f1 /proc/loadavg) / $(nproc)" | bc -l

    Over 1.0 = more work than cores.

  5. 5Raw load data

    cat /proc/loadavg
    0.15 0.10 0.09 1/182 4410

    Also running/total processes and the last PID.

  6. 6Watch the load

    watch -n 5 uptime

    The 1-minute value reacts first.

  7. 7On many servers

    for h in server1 server2; do echo -n "$h: "; ssh $h uptime; done

    Quick overview.

  8. 8Unexpected reboot? (security)

    uptime -s; last -x reboot | head -3

    Compare with the change calendar.

  9. 9Same line in w and top

    w | head -1

    w and top show the uptime line first.

  10. 10Alert on high load in a script

    awk -v c=$(nproc) '$1 > c {print "high load: " $1}' /proc/loadavg

    Simple check for cron.

Bestanden

/proc/uptime
Seconds since boot.
/proc/loadavg
Load averages.

Exitcodes

0 :: Done. 1 :: Error.

Volledige handleiding

Deze pagina legt het commando uit in eenvoudige woorden. De originele handleiding heeft elk detail.

In je terminal: man uptime