nice: start a command with specified priority

Runs a command with a specified priority

Typical usage: automation tasks, shell scripting, system administration

Introduction into nice

The nice tool can be used on Linux to start commands with a specified priority. This is useful to start tasks that may need to run for a while but at a low priority, to reduce the impact on the system or its performance.

Installation

When nice is not installed by default, it can be added to the system using the relevant software package.

Package information for nice

Operating systemPackage nameInstallation
AlmaLinuxcoreutils
dnf install coreutils
Arch Linuxcoreutils
pacman -S coreutils
Debiancoreutils
apt install coreutils
Fedoracoreutils
dnf install coreutils
Red Hat Enterprise Linuxcoreutils
dnf install coreutils
Rocky Linuxcoreutils
dnf install coreutils
openSUSEcoreutils
zypper install coreutils
Ubuntucoreutils
apt install coreutils

Your Linux distribution using a different package? Share your feedback.

Usage

Available options

Long optionShort optionDescription
--adjustment-nSets priority (-20 is highest, 19 lowest)

Missing an option in this overview? Share your feedback.

Examples using nice

Runs the nice command with priority 15, then shows the priority

nice -n 15 nice

Output: 15

Runs a script with lowest priority

nice --adjustment=19 /mnt/scripts/lowest-priority-script

Frequently Asked Questions

What is the nice command and its purpose?

The nice command is a command-line tool to run commands with a specified priority.

Which package provides the nice command?

The command nice is provided by the coreutils package.

Relevant articles using the nice command

The following articles include an example on how to use nice and might be worth further exploring.

Related and similar commands

Linux has a lot of tools and commands available and sometimes you just need that little other tool. Here is a list of commands that are similar or related to nice:

Related and similar commands to nice
CommandCategorySummary
basenamefilesStrips directory and file name suffix from a given path
chrtprocessesSets Linux scheduler policy and priority for a process or command
killprocessesSending signals to processes
numactlprocessesControls NUMA policy for processes and shared memory
peekfdprocessesTracks a process and show file descriptor activity
pidofprocessesReturns process IDs for a process name
pidstatmonitoringMonitoring CPU, memory, and disk activity
pidwaitprocessesWait for process to stop
pmapprocessesShows memory mapping of process
prtstatprocessesShows process details for selected process like state, CPU and memory usage
pscapcapabilitiesDisplay available capabilities for running processes
pslogloggingShows which log files a process has opened
pstreeprocessesShow active processes and children like a tree
pwdxprocessesShows current working directory of a process
reniceprocessesChanges the priority of running processes
revdataShows text in reverse order
slabtopmemoryShows slab usage of kernel
smemmemoryShow memory usage including swap
straceprocess inspectionInspects running process
unitsdata conversionConverts a unit into another one, like from Celcius to Fahrenheit
watchprocessesMonitors changes in output of specified command