nice

>Usage

The nice command in Unix is used to start a process with a specified priority, helping manage system resources by adjusting CPU priority levels.

nice can prevent a single process from monopolizing CPU resources.

>Synopsis

nice [option] [command]

>Options

-n

The -n option sets a niceness value for the command, with higher values meaning lower priority.

Example:

Dots

-zsh

> nice -n 10 your_command


This command runs "your_command" with a niceness value of 10.

adjustment

Changes the niceness by an adjustment. Positive values reduce priority, negative values increase it.

Example:

Dots

-zsh

> nice -adjustment 5 your_command


This command runs "your_command" with a niceness adjustment of 5.

priority value

Directly sets a priority value, generally between -20 (highest) and 19 (lowest).

Example:

Dots

-zsh

> nice -10 your_command


This command runs "your_command" with a priority value of -10.

>Quiz

Progress: Question ? out of 4

Question Title

Page written by Emily Pable