renice — Change priorities of a running process
Format
- renice [–n increment] [–g|–p –u] ID …
- renice priority [–p] pid … [–g pgrp …] [–p pid …] [–u user …]
- renice priority –g pgrp … [–g pgrp …] [–p pid …] [–u user …]
- renice priority –u user … [–g pgrp …] [–p pid …] [–u user …]
Description
renice changes the priority of one or more running processes. Normal users can change only the priority of processes that have the same real or effective user ID as the real or effective user ID of the process that calls renice. Privileged users can set the priority of any process.
You can specify the new priority as a decimal integer, with higher values indicating more urgent priority. The range of priorities is site-specific, and you may require appropriate privileges for some priority values.
When you change the priority of a process group, the priority of all processes in that group are changed.
If the string -- appears in the arguments, renice does not interpret it as the end of command-line arguments. This is an exception to the usual POSIX syntax rules.
Options
- –g
- Treats all following IDs (or just pgrps in the obsolescent versions) as process group IDs.
- –n increment
- Adjusts the system scheduling priority of the specified processes
by increment. Positive increments
lower the priority while negative increments
result in a higher priority. Note: Negative increments may require appropriate privileges.
- –p
- Treats all following IDs (or just pids in the obsolescent versions) as process IDs.
- –u
- Treats all following IDs (or just users in the obsolescent versions) as either user names or numeric user IDs.
- priority
- A number that indicates an absolute priority value (higher numbers reflect higher priorities).
If no –p, –g, or –u option appears on the command line, renice assumes –p.
Localization
- LANG
- LC_ALL
- LC_CTYPE
- LC_MESSAGES
- NLSPATH
See Localization for more information.
Exit values
- 0
- Successful completion
- 1
- Failure due to one of the following:
- Incorrect command-line argument
- The wrong number of command-line arguments
- A priority that is outside the range
- An incorrect priority argument
- An incorrect ID argument
- Missing arguments following one of the options
- 2
- Failure because the system does not recognize the ID in a –u option
Portability
POSIX.2 User Portability Extension, UNIX systems.
POSIX considers all but the first form of the renice command to be obsolescent.
Related information
nice