Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)
User Commands (m - o) nice(1)
NAME
nice - Runs a command at a different priority
SYNOPSIS
nice [-n priority ] command [argument ... ]
FLAGS
-n priority
Specifies how the system scheduling priority of the executed utility is to be adjusted.
The priority argument is a positive or negative decimal integer that changes the nice
value used when determining scheduling priority. Positive priority values cause a
lower or unchanged system scheduling priority. Negative priority values require
appropriate privileges and cause a higher or unchanged system scheduling priority.
DESCRIPTION
The nice command lets you run the command specified by command at a different priority. The
argument operand passes a command flag, operand, or other argument to the specified command.
For users without appropriate privileges, the value of priority can be in the range 1 through 19,
with 19 being the lowest priority. The default value of priority is 10.
For users with appropriate privileges, the value of priority can be in the ranges 1 through 19 or -1
through -19. The highest possible priority is -19.
When you have appropriate privileges, you can run commands at a higher priority by specifying
priority as a negative number; for example, -10.
If you lack appropriate privileges to affect command priority, nice is still invoked, but the change
in priority you specify does not take effect.
Refer to the nice(2) reference page for a description of the relationship among the nice value for
a process, the OSS scheduling priority for the process, and the Guardian priority for the process.
Environment Variables
This command supports the use of the LANG, LC_ALL, LC_CTYPE, LC_MESSAGES,
NLSPATH, and PATH environment variables.
EXAMPLES
1. To run the c89 utility as a low-priority command in the background, enter:
nice c89 -c *.c &
This command executes the command c89 -c *.c at a low priority in the background.
Your terminal is free so that you can run other commands while c89 is running. Refer to
the sh(1) reference page for details about starting background processes with & (amper-
sand).
2. To specify a very low priority for the c89 utility, enter:
nice -n 15 c89 -c *.c &
This command executes the command c89 -c *.c in the background at a priority that is
even lower than the default priority set by nice.
EXIT VALUES
The nice command returns the following exit values:
1-125 An error occurred in the nice utility.
126 The specified command was found but could not be invoked.
527188-007 Hewlett-Packard Company 6−37