The renice command in Unix/Linux is used to alter the priority (niceness) of an existing process. Like nice, the niceness value ranges from -20 (highest priority) to +19 (lowest priority). renice is typically used when a process needs to be deprioritized or given more CPU resources after it has started.
>Synopsis
renice [-n | -p | -u | -g ...]
>Options
Changing niceness by PID
Adjusts the niceness of a specific process by providing its process ID (PID).
Example:
-zsh
> renice -n 10 -p 1234
Changes the niceness of process 1234 to 10, lowering its priority
Changing niceness of multiple processes
Adjusts the niceness of several processes by specifying multiple PIDs.
Example:
-zsh
> renice -n 15 -p 1234 5678
Changes the niceness of processes 1234 and 5678 to 15, lowering their priority
Changing niceness by user
Adjusts the niceness of all processes owned by a specific user.
Example:
-zsh
> renice -n 5 -u john
Changes the niceness of all processes owned by user john to 5, increasing priority
Changing niceness by group
Adjusts the niceness of all processes associated with a specific group ID (GID).
Example:
-zsh
> renice -n 8 -g 100
Changes the niceness of all processes in group ID 100 to 8