72. Process Management - nice and renice
Contents
With the nice and renice commands, we can specify the priority of a program when it starts, or change the priority of a running process.
Options
nice Command Options
Here are some options for nice command:
Option | Description |
---|---|
-n or ‑‑adjustment=N | Replace the niceness (priority level) of the specified program with the number N. |
renice Command Options
Here are some options for renice command:
Option | Description |
---|---|
-n or ‑‑priority priority | Replace the niceness (priority level) of the specified program with the number priority. |
-g or ‑‑pgrp | The process group ID(s) is/are specified. |
-p or ‑‑pid | The process ID(s) is/are specified. |
-u or ‑‑user | The username(s) or ID(s) is/are specified. |
Examples
Run the Program With Specified Niceness in Terminal One
|
|
Adjust the Niceness of the Top Command in Terminal Two
|
|
After adjusted the niceness, let’s look back at terminal one:
Author Dong Chen
LastMod Sat Apr 13 2019