Go to main content

Managing System Information, Processes, and Performance in Oracle® Solaris 11.4

Exit Print View

Updated: August 2018
 
 

Changing the Priority of a Process

As a user, you can only lower the priority of a process. However,as an administrator, you can raise or lower the priority of a process.

  • As a user, you can lower the priority of a command by increasing the nice number.

    The following nice command executes command-name with a lower priority by raising the nice number by 5 units.

    $ /usr/bin/nice -5 command-name

    In this command, the minus sign designates that what follows is an option. This command could also be specified as follows:

    $ /usr/bin/nice -n 5 command-name

    The following nice command lowers the priority of command-name by raising the nice number by the default increment of 10 units, but not beyond the maximum value of 39.

    $ /usr/bin/nice command-name
  • As an administrator, you can raise or lower the priority of a command by changing the nice number.

    The following nice command raises the priority of command-name by lowering the nice number by 10 units. It is not lowered below the minimum value of 0.

    # /usr/bin/nice --10 command-name

    In this command, the first minus sign designates that what follows is an option. The second minus sign indicates a negative number.

    The following nice command lowers the priority of command-name by raising the nice number by 5 units. It does not exceed the maximum value of 39.

    # /usr/bin/nice -5 command-name

For more information, see the nice(1) man page.