System and processes
The renice command
Changes the priority of running processes, by PID, group or user.
Most useful options
-n NSets the absolute priority; if POSIXLY_CORRECT is set, it is relative. If used, it must come first--relative NAdds N to the current priority instead of setting it. Only in recent util-linux versions-p, --pidArguments are process IDs. It is the default-g, --pgrpArguments are process group IDs: changes all their processes-u, --userArguments are usernames or UIDs: changes all their processes-h, --helpShows the help and exitsCopy-ready examples
$ sleep 100 &starts a test process. Note its PID with ps or pgrep.$ renice -n 10 -p 4321sets the priority of process 4321 (example PID), already running, to 10.Example output
4321 (process ID) old priority 0, new priority 10
$ renice --relative 5 -p 4321adds 5 to the current priority of the process. Requires a recent util-linux version.$ renice -n 19 -u miguelsets all processes of user miguel to the lowest priority.$ sudo renice -n -5 -p 4321raises the priority above 0. Requires root.You can try them in the browser terminal: it does not touch your computer.
Common errors
| Message | Cause | Fix |
|---|---|---|
| renice: failed to get priority for 99999 (process ID): No such process | No process has that PID: it already ended or the number is mistyped. | Find the current PID with pgrep -l name or ps before running renice. |
| renice: not enough arguments | The target is missing: renice only got the priority, with no PID, group or user. | Add the target, for example: renice -n 10 -p PID. |
Typical mistakes
- Check the PID with ps -l before changing it: a reused PID may already point to another process.
- Without root you can only raise the number. Going back depends on your user's RLIMIT_NICE limit.
- With -u or -g you affect every process of the target, not just one. Check what it covers first.
Differences from similar commands
- nice: starts a new program with an adjusted priority. renice changes one that already exists.
- top: shows live processes and lets you change their priority with the r key. renice does it from the command line.
ionice: sets the disk access priority, not the CPU one. It is another lever for the same problem.
FAQ
How do I change the priority of every process of one user?
Use -u and the name: renice -n 10 -u name. It changes all their processes at once.
What is RLIMIT_NICE?
A resource limit that lets a normal user lower the nice number down to a set value, so changes can be reverted. Checked with ulimit -e.
What happens if the process ends before renice acts?
You get the no-such-process error, because the PID no longer exists.
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