February 2004
Beginner
200 pages
5h 40m
English
nice [-priority] command_line — coreutils
/bin stdin stdout - file -- opt --help --versionWhen invoking a system-intensive program, you might want to be nice to the other processes (and users) by lowering its priority. That’s what the nice command is for. Here’s an example of setting a big job to run at priority 7:
$ nice -7 sort VeryLargeFile > outfile
If you don’t specify a priority, 10 is used. To find out the default priority (i.e., what you’d get if you didn’t run nice), type nice with no arguments:
$ nice 0
If you’re the superuser, you can also raise the priority (lower the number):
$ nice --10
(Yes, that’s “dash negative 10”.) To see the nice levels of your jobs, use ps and look at the “NI” column:
$ ps -o pid,user,args,nice
Read now
Unlock full access