nice flags & options
Basic usage
Run a command with lower priority (niceness 10 by default).
nice ./heavy_computation.sh
-n, --adjustment
Set a specific niceness adjustment. Range: -20 (highest priority) to 19 (lowest).
nice -n 15 make -j8
nice -n 19 find / -name "*.log"
High priority
Negative values increase priority (requires root).
sudo nice -n -10 ./critical_process
Check current niceness
nice
renice
Change the priority of a running process.
renice 10 -p 1234
sudo renice -5 -p 1234
Renice by user
Change priority for all processes owned by a user.
sudo renice 15 -u username
Combine with other tools
nice -n 19 tar czf backup.tar.gz /home/
nice -n 10 ffmpeg -i input.mp4 -c:v libx264 output.mp4