System and processes
The renice command
Changes the priority of a process that is already running.
Syntax
renice -n N -p PIDMost useful options
-n NThe new priority-p PIDThe process to changeCopy-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 priorityYou 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.
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