nice and renice
These two commands are very handy for setting program priorities. -20 is the highest or nicest and 19 is the lowest. All you have to do is run your program with nice in front of it.
# nice -15 your_program
The example above uses 15 which is pretty high priority. If I had used,
# nice -+15 your_program
this would be a very low priority. This is like golf, low scores are high.
To change a priority, use renice. Just find the pid of your program. I do this with
# ps -edalf | grep "my_program"
Your pid will be the 4th column, or the number after your username which should be the 3rd column. -edalf doesn't work on all distributions. It definitely doesn't work on the Mac, in which case I use -aux. Just read your man pages and find the pid.
Once you have your pid, you can use the command
renice -20 pid_of_your_program
[Click to add or edit comments])
Please prepend comments below including a date