May 2017
Beginner
552 pages
28h 47m
English
Invoking the nice command with no arguments will report a task's current priority:
$ cat nicetest.sh
echo "my nice is `nice`"
$ sh nicetest.sh
my nice is 0
Invoking the nice command followed by another command name will run the second command with a niceness of 10–it will add 10 to the task's default priority:
$ nice sh nicetest.sh
my nice is 10
Invoking the nice command with a value before the command will run the command with a defined niceness:
$ nice -15 sh nicetest.sh
my nice is 15
Only a superuser can give a task a higher priority (lower priority number), by assigning a negative niceness value:
# nice -adjustment=-15 nicetest.sh
my nice is -15