Process Niceness (nice & renice)
Concept & Overview
In a busy office, some low-priority tasks (like filing receipts) can wait, while high-priority requests must be handled immediately. Linux manages process priority using niceness values ranging from -20 (highest priority) to 19 (lowest priority).
- The nice command launches a process with a customized priority. E.g. nice -n 10 sleep 5 starts a sleep command with a polite priority of 10.
- The renice command alters the scheduling priority of an already-running process. E.g., sudo renice +5 9999 lowers the priority of process 9999.
nice -n 10 sleep 5. Then, lower the priority of the running rogue process 9999 by running sudo renice +5 9999.Command Syntax Reference
| Command / Syntax | Description |
|---|---|
nice -n 10 sleep 5 | Start sleep with a niceness value of 10 |
sudo renice +5 9999 | Lower priority of PID 9999 |
Verification Objectives
These conditions will be automatically verified when you run commands inside the interactive terminal simulator:
- ○Run the "nice" command with -n 10
- ○Run the "renice" command with sudo
Ready to complete Quest 65?
Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.