Table of Contents

Linux Commands#System

nicd - How to use nice command on Linux



man nice

NAME
       nice - run a program with modified scheduling priority

SYNOPSIS
       nice [OPTION] [COMMAND [ARG]...]

DESCRIPTION
       Run COMMAND with an adjusted niceness, which affects process scheduling.  With no COMMAND, print the current niceness.
       Niceness values range from -20 (most favorable to the process) to 19 (least favorable to the process).


A niceness of −20 is the highest priority and 19 is the lowest priority.

nice (Unix)


Example

# nice -n 19 sleep 30
# ps axo pid,comm,nice |grep sleep
25106 sleep             0
25158 sleep            19
#

# renice -n 18  25158
25158 (process ID) old priority 19, new priority 18
#

# ps axo pid,comm,nice |grep sleep
25106 sleep             0
25158 sleep            18
#