Featured

    Featured Posts

nice and renice commands

nice command
Sometimes you may want to change a priority of a process. For example, you might run a process that is very important to you and you want it to finish quickly. You can change the process priority using the nice command.
Every process running on your system has a nice value. By default, the nice value is set to 0. The process priority range is from -20 to 19.
Here are a few facts about changing the priority of a process:
  • the lower number is better (the process will get more CPU time)
  • a regular user can set nice values only from 0 to 19 and only on the user’s own processes.
  • a regular user can set the nice value only higher, not lower
For example, to launch vim with a priority of 15, we would type the following command:
linux nice command 1
To launch vim with a negative priority of -15, we would use the following command:
linux nice command 2
Notice that we had to supply the root password. That is because we wanted to specify a negative priority, which can be done only by root.
renice command
The renice program can be used to change the priority of a process that is already running. Only root can lower the priority of a process. You need to specify the PID of the process whose priority you would like to modify. For example, to modify the priority of the process with the PID of 14475 we would use the following command:
linux renice command
author

Author Name

Author Description!

Get Free Email Updates to your Inbox!

Post a Comment

www.ccna.ma

yu
Powered by Blogger.

Translate

Copyright © Learn Linux Th3pro.xyz | Blogger Templates | Designed By Code TAOUSSI