$linuxjunkies
>

renice(8)

Alter the scheduling priority of running processes.

UbuntuDebianFedoraArch

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

FlagWhat it does
-n priorityThe priority value to set (typically -20 to 19); required argument
-p pidInterpret following arguments as process IDs (explicit, often optional)
-g pgrpInterpret following arguments as process group IDs
-u userInterpret 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 1234

Raise the priority of process 5678 to -5 (only works if run as root)

renice -n -5 -p 5678

Lower the priority of all processes owned by user alice to nice value 15

renice -n 15 -u alice

Set nice value to 5 for all processes in process group 2048

renice -n 5 -g 2048

Set nice value to -10 for multiple processes at once (requires root)

sudo renice -n -10 -p 1000 2000 3000

Lower the priority of the current shell process by 5 steps

renice -n +5 $$

Related commands