System and processes

The renice command

Changes the priority of a process that is already running.

Syntax

renice -n N -p PID

Most useful options

-n NThe new priority
-p PIDThe process to change

Copy-ready examples

$ sleep 100 & && ps -lLook at the NI column and the PID
$ sleep 100 & && PID=$(pgrep sleep) && renice -n 10 -p $PIDLower the process priority

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • You need the right PID: check it with ps or pgrep.
  • Only root can raise priority below 0.

Related commands

FAQ

Does it survive a process restart?

No: the priority belongs to the process while it lives.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course