NICE(1,C) AIX Commands Reference NICE(1,C)
-------------------------------------------------------------------------------
nice
PURPOSE
Runs a command at a different priority.
SYNTAX
+-- -10 ---+
nice ---| 1|-- cmdstring --|
+- number -+
-----------------
1 Maximum increment is 19.
DESCRIPTION
The nice command lets you run the specified command at a lower priority. The
value of -number can range from 1 to 19, with 19 being the lowest priority.
The default value of -number is 10.
If you have superuser authority, you can run commands at a higher priority by
specifying -number as a negative number, such as "--10".
EXAMPLES
1. To run a command at low priority:
nice cc -c *.c
This command runs "cc -c *.c" at low priority. This does not run the
command in the background. Your work station is not available for doing
other things.
2. To run a low priority command in the background:
nice cc -c *.c &
This command runs "cc -c *.c" at low priority in the background. Your work
station is free so that you can run other commands while cc is running.
See page sh-2 for details about starting background processes with "&".
3. To specify a very low priority:
nice -15 cc -c *.c &
Processed November 8, 1990 NICE(1,C) 1
NICE(1,C) AIX Commands Reference NICE(1,C)
This command runs "cc" in the background at a priority that is even lower
than the default priority set by nice.
4. To specify a very high priority:
nice --10 wall <<end
System shutdown in 2 minutes!
end
This command runs "wall" at a higher priority than all user processes.
Doing this slows down everything else running on the system. If you do not
have superuser authority when you run this command, the wall command runs
at the normal priority.
The "<<end" and "end" define a "Here Document," which uses the text entered
before the "end" line as standard input for the command. For more details,
see "Inline Input Documents."
RELATED INFORMATION
See the following commands: "csh" and "nohup."
Note: The csh command contains a built-in subcommand named nice. The command
and subcommand do not necessarily work the same way. For information on
the subcommand, see the csh command.
See the getpriority and setpriority system calls in AIX Operating System
Technical Reference.
Processed November 8, 1990 NICE(1,C) 2