Process Priorities with nice, renice, and Signals
Control how much CPU processes get using nice and renice, and learn how signals let you communicate with running processes beyond just killing them.
Process Priorities with nice, renice, and Signals is a free Linux Command Line Mastery lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Linux Command Line Mastery learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Beyond Starting and Stopping
You already know how to view processes with ps/top and stop them with kill. But sometimes a process should simply run more politely so it does not starve others of CPU.
That is what nice and renice are for.
What Is a Niceness Value?
Every process has a niceness from -20 (highest priority) to 19 (lowest priority). A nicer process yields CPU to others. Default is 0.
Starting a Process with nice
nice -n N command launches a command with niceness N. Higher numbers are friendlier to the rest of the system.
nice -n 10 tar -czf backup.tar.gz /var/logViewing Niceness
The NI column in top shows niceness. With ps you can request it explicitly.
ps -o pid,ni,comm -p 1Changing Priority with renice
renice adjusts the niceness of an already running process by PID.
renice -n 5 -p 1234Why You Need Root to Raise Priority
Any user can make a process nicer (raise the number). Only root can give a process a negative niceness, because that takes CPU away from everyone else.
sudo renice -n -5 -p 1234Signals: More Than kill
The kill command really sends a signal. SIGTERM (15) asks nicely to stop; SIGKILL (9) forces it; SIGHUP (1) often tells a daemon to reload config.
kill -lReloading Without Restarting
Sending SIGHUP to many services makes them re-read their configuration without a full restart, avoiding downtime.
kill -HUP 4567Pausing and Resuming a Process
SIGSTOP freezes a process and SIGCONT resumes it, handy for temporarily relieving load.
kill -STOP 4567
kill -CONT 4567Targeting by Name
pkill and killall let you send signals by process name instead of PID.
pkill -HUP nginxPutting It Together
A typical admin flow: spot a CPU hog in top, lower its priority with renice instead of killing it, and only escalate to kill -9 if it misbehaves.
renice -n 15 -p 8899 || kill -TERM 8899Quick Check
Which niceness value gives a process the highest CPU priority?
Recap
You learned to fine-tune process behavior:
nice -n N cmdstarts at a chosen priorityrenicechanges priority of running PIDs- Negative niceness needs root
- Signals like
SIGTERM,SIGHUP,SIGSTOP/SIGCONTcontrol processes without killing them
Frequently asked questions
Is the “Process Priorities with nice, renice, and Signals” lesson free?
Yes — the full text of “Process Priorities with nice, renice, and Signals” is free to read here on the web, and the Linux Command Line Mastery course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Linux Command Line Mastery course, upgrade to CoddyKit PRO.
What will I learn in “Process Priorities with nice, renice, and Signals”?
Control how much CPU processes get using nice and renice, and learn how signals let you communicate with running processes beyond just killing them. You practise Linux Command Line Mastery with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Linux Command Line Mastery?
No prior experience is required. Linux Command Line Mastery on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Process Priorities with nice, renice, and Signals” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Linux Command Line Mastery lesson?
Yes. Every Linux Command Line Mastery lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Understanding Processes: `ps`, `top`, `htop`
- Managing Processes: `kill`, `bg`, `fg`
- Monitoring System Resources: `df`, `du`, `free`
- Process Priorities with nice, renice, and Signals