nice - Runs a command at a different priority
Current syntax
nice [-n priority] command [argument...]
Obsolescent syntax [Toc] [Back]
nice [-priority] command [argument...]
Note
The C shell has a built-in version of the nice command.
If you are using the C shell, and want to guarantee that
you are using the command described here, you must specify
the full path /usr/bin/nice. See the csh(1) reference
page for a description of the built-in command.
Interfaces documented on this reference page conform to
industry standards as follows:
nice: XCU5.0
Refer to the standards(5) reference page for more information
about industry standards and associated tags.
Specifies how the system scheduling priority of the executed
utility is adjusted. The priority argument is a
positive or negative decimal integer.
Positive priority values cause a lower or unchanged
system scheduling priority.
Negative priority values might require appropriate
privileges and cause a higher or unchanged system
scheduling priority. Specifies how the system
scheduling priority of the executed utility is
adjusted. (Obsolescent)
The name of a utility that is to be invoked. Any string
to be supplied as an argument to the utility named by the
command operand.
The nice command lets you run the specified command at a
lower priority. The value of priority can range from 1 to
19, with 19 being the lowest priority. The default value
of priority is 10.
[Tru64 UNIX] If you have superuser authority, you can run
commands at a higher priority by specifying priority as a
negative number; for example, -10.
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.
The nice command returns the following exit values: An
error occurred in the nice utility. The specified command
was found but could not be invoked. The specified command
could not be found.
To run a low priority command in the background, enter:
nice cc -c *.c &
This runs the command cc -c *.c at low priority in
the background. Your terminal is free so that you
can run other commands while cc is running. See the
sh command for details about starting background
processes with an & (ampersand). To specify a very
low priority, enter: nice -n 15 cc -c *.c &
This runs cc in the background at a priority that
is even lower than the default priority set by
nice. To specify a very high priority (ksh and sh
only), enter: nice -n -10 wall <<end System shutdown
in 2 minutes! end
This 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, then the wall
command runs at the normal priority.
The <<end and end arguments define a Here Document,
which uses the text entered before the end line as
standard input for the command. For more details,
see the Inline Input (Here) Documents section on
the sh(1) reference page.
ENVIRONMENT VARIABLES [Toc] [Back] The following environment variables affect the execution
of nice: Provides a default value for the internationalization
variables that are unset or null. If LANG is unset
or null, the corresponding value from the default locale
is used. If any of the internationalization variables
contain an invalid setting, the utility behaves as if none
of the variables had been defined. If set to a non-empty
string value, overrides the values of all the other internationalization
variables. Determines the locale for the
interpretation of sequences of bytes of text data as characters
(for example, single-byte as opposed to multibyte
characters in arguments). Determines the locale for the
format and contents of diagnostic messages written to
standard error. Determines the location of message catalogues
for the processing of LC_MESSAGES. Determines the
search path used to locate the command invoked.
Commands: csh(1), nohup(1), renice(8)
Functions: nice(3), setpriority(2)
Standards: standards(5)
nice(1)
[ Back ] |