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 COMMANDParameters & Attributes
| Name | Type | Description |
|---|---|---|
| -n | option | adjustment |
| ADJUSTMENT | operand | integer increment |
| COMMAND | operand | program |
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