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

renice

Change the nice value (CPU priority) of running processes, by PID, process group or user.

Niveau
RHCSA-examen
Groep
Processen en jobs
Root nodig
Voor wijzigingen
Pakket
util-linux

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

Wat het doet

renice -n VALUE -p PID sets the new nice value of a running process. With -u USER it changes all processes of a user. Normal users can only make their own processes nicer; root can do anything.

Zo schrijf je het

renice [-n] PRIORITY [-g|-p|-u] ID...
renice --relative N [-g|-p|-u] ID...

Opties 7

Meest gebruikt

-n, --priority PRIORITY
The new nice value (-20 … 19).
--relative N
Add N to the current value.
-p, --pid
The IDs are PIDs (default).
-g, --pgrp
The IDs are process group IDs.
-u, --user
The IDs are user names or UIDs.
-h, --help
Show help.
-V, --version
Show the version.

Voorbeelden 10

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

  1. 1Make a process nicer

    renice -n 10 -p 4123
    4123 (process ID) old priority 0, new priority 10

    It now gives way to other processes.

  2. 2Give a process more priority (root)

    renice -n -10 -p $(pidof myapp)

    Only root may lower the value.

  3. 3All processes of a user

    renice -n 15 -u lisa

    A user with heavy jobs slows others less.

  4. 4Normal user tries to go back

    renice -n 0 -p 4123
    renice: failed to set priority for 4123 (process ID): Permission denied

    Users cannot raise their own priority again.

  5. 5Add to the current value

    renice --relative 5 -p 4123

    From 10 to 15.

  6. 6Several processes at once

    renice -n 5 -p $(pgrep -d ' ' dd)

    All dd processes.

  7. 7Change a whole process group

    renice -n 10 -g 4120

    A pipeline started together.

  8. 8From top

    top

    Press r, type the PID and the new value.

  9. 9Check the result

    ps -o pid,ni,cmd -p 4123

    Column NI.

  10. 10Slow down a crypto miner while you investigate (security)

    renice -n 19 -p 6666; kill -STOP 6666

    Stop it first, then collect evidence before you kill it.

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 renice