The nice command

In its simplest terms, the nice command is used for manipulating process niceness with regard to CPU resource availability. When we say niceness, this is referring to the attention or priority given to a particular process for the CPU resources. We can increase or decrease priority for a given process. This becomes relevant whenever the CPU is being bogged down by a number of processes, each fighting for its own attention. By changing the niceness for a particular process, we are affecting the process scheduling.

We can view the current nice value for processes using the ps command; we would pass the al option:

root@ubuntu:/home/philip# ps -alF S UID PID  PPID C PRI  NI ADDR SZ WCHAN TTY  TIME CMD4 S 0 2423 2271 0 80 0 - 13698 ...

Get CompTIA Linux+ Certification Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.