O'Reilly logo

CompTIA Linux+ Certification Guide by Philip Inshanally

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required