nice(1)nice(1)NAMEnice - Runs a command at a different priority
SYNOPSIS
Current syntax
nice [-n priority] command [argument...]
Obsolescent syntax
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.
STANDARDS
Interfaces documented on this reference page conform to industry stan‐
dards as follows:
nice: XCU5.0
Refer to the standards(5) reference page for more information about
industry standards and associated tags.
OPTIONS
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)
OPERANDS
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.
DESCRIPTION
The nice command lets you run the specified command at a lower prior‐
ity. 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.
NOTES
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.
EXIT STATUS
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.
EXAMPLES
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 back‐
ground. Your terminal is free so that you can run other commands
while cc is running. See the sh command for details about start‐
ing 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 Sys‐
tem 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) Docu‐
ments section on the sh(1) reference page.
ENVIRONMENT VARIABLES
The following environment variables affect the execution of nice: Pro‐
vides 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 vari‐
ables contain an invalid setting, the utility behaves as if none of the
variables had been defined. If set to a non-empty string value, over‐
rides 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 multi‐
byte characters in arguments). Determines the locale for the format
and contents of diagnostic messages written to standard error. Deter‐
mines the location of message catalogues for the processing of LC_MES‐
SAGES. Determines the search path used to locate the command invoked.
SEE ALSO
Commands: csh(1), nohup(1), renice(8)
Functions: nice(3), setpriority(2)
Standards: standards(5)nice(1)