renice(8)
Alter the scheduling priority of running processes.
Synopsis
renice [-n] priority [[-p] pid ...] [[-g] pgrp ...] [[-u] user ...]Description
renice alters the scheduling priority (nice value) of one or more running processes. A process with a higher nice value runs at lower priority. Only the superuser can lower the nice value (increase priority); ordinary users can only raise it (decrease priority). Nice values range from -20 (highest priority) to 19 (lowest priority).
You can specify processes by process ID (pid), process group (pgrp), or username (user). If no option flag is given, the first argument is treated as a pid.
Common options
| Flag | What it does |
|---|---|
-n priority | The priority value to set (typically -20 to 19); required argument |
-p pid | Interpret following arguments as process IDs (explicit, often optional) |
-g pgrp | Interpret following arguments as process group IDs |
-u user | Interpret following arguments as usernames; renice all processes owned by that user |
Examples
Lower the priority of process 1234 by setting its nice value to 10
renice -n 10 1234Raise the priority of process 5678 to -5 (only works if run as root)
renice -n -5 -p 5678Lower the priority of all processes owned by user alice to nice value 15
renice -n 15 -u aliceSet nice value to 5 for all processes in process group 2048
renice -n 5 -g 2048Set nice value to -10 for multiple processes at once (requires root)
sudo renice -n -10 -p 1000 2000 3000Lower the priority of the current shell process by 5 steps
renice -n +5 $$