Skip to content

Monday, November 30th, 2009

New Linux User

HOWTO: Change Process Priority Using the Nice Command

May 15, 2006 by Jon  
Filed under How To

Amongst other things, the Linux kernel is responsible for making all running processes interact well with each other. One of the ways in which it does this is by determining which applications should get more CPU time than others. By default, the kernel handles this without interaction from the user, but there may be cases where you want to increase or decrease a process or application’s priority.

If you know before you launch the program or process that you want to manipulate its priority, you can launch it with the nice command.

Nice can be used with an integer from 0-19 if you are a normal user, and -20 to 19 if you are the superuser. Strangely, positive numbers decrease the application’s priority and negative numbers increase it. Hence why only the superuser (root) can elevate a processes’ priority via negative nice numbers.

The basic syntax of the nice command is:

nice process/application [nice number] [options]

nice foo –15 &

This command will start application foo at an elevated priority of -15 and push it to the background (&). If you don’t specify a nice number, the default of 10 is used.

What if you want to change an already running processes’ nice number? You would have to use the command renice which I will cover tomorrow.

  • StumbleUpon
  • Digg
  • Facebook
  • Mixx
  • Google
  • TwitThis
  • Reddit
  • Yahoo! Buzz
  • Slashdot
  • E-mail this story to a friend!

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!


About Us | Advertise with us | Blog for EveryJoe | Privacy Policy | Terms of Use
Get This Theme | Sitemap


All content is Copyright © 2005-2009 b5media. All rights reserved.