commands

nice — adjust inherited niceness

Run a command with a niceness adjustment relative to the inherited value. Larger nice generally reduces scheduling preference for ordinary tasks. No fixed CPU percentage. Use a fresh private workspace, ordinary user and bounded child processes; no sudo.

Formal Syntax & Structure

linux syntaxlinux
nice -n ADJUSTMENT COMMAND

Parameters & Attributes

NameTypeDescription
-noptionadjustment
ADJUSTMENToperandinteger increment
COMMANDoperandprogram

Return Value

exit status and output

Run a command with a niceness adjustment relative to the inherited value. Larger nice generally reduces scheduling preference for ordinary tasks. No fixed CPU percentage.

Working Example

Example Snippetlinux
base=$(nice)child=$(nice -n 5 nice)if (( child >= base )); then printf 'preference not increased\n'; else exit 1; fi
Linux Reference