Every process on a GNU/Linux system has a nice value, which helps determines its importance regarding access to computing resources, relative to other processes. These values can be modified.
Note: If you are not familiar with the GNU/Linux command line interface, review the Conventions page before proceeding.
nice command can start a program with a modified scheduling priority:
When provided a command name (i.e.,
nice command starts a process with a lower priority level. By default, this priority level is
A specific priority level can be specified via the
nice -n ex_nice_value ex_command
For example, the following command starts
gedit with a nice value of
nice -n 15 'gedit'
If a process is already running, the
renice command can be used to alter its priority.
renice ex_nice_value ex_identifier...
Aside from being the name of a process,
ex_identifier can also be a process group ID (GID)/group name if the
--pgrp) option is used, or a user ID (UID)/username if the
--user) option is used.
reniceing a process group causes all processes in the process group to have their scheduling priorities altered.
reniceing a user causes all processes owned by the user to have their scheduling priority altered.
Users other than the root user may only alter the priority of processes they own. Also, a non-root user can only increase the nice value (i.e., select a lower priority) for a process and this change is irreversible, unless the user has a sufficient
nice resource limit (run
man 1 ulimit and
man 1 getrlimit for more information).
If you want to decrement or increment a priority level for a running process, instead of specifying a specific priority level, you can do so with
renice -ex_nice_value ex_identifier...
renice +ex_nice_value ex_identifier...
renice -ex_nice_value $(pgrep ex_target)
renice +ex_nice_value $(pgrep ex_target)
For more on the
renice commands, refer to their man pages by running
man 1 nice and
man 1 renice, respectively.