Linux basic command-appreciation program priority nice
Nice
The nice instruction can set the priority of running the program, and the priority will affect the scheduling time of the program. The range of nice is-20 to 19, where-20 is the highest and 19 is the lowest.
The scope of this command: RedHat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.
1. Grammar
Nice [options] [cmd]
2. List of options
Option
Description
-- help
Show help documentation
-- version
Show command version
-n |-- adjustment=N
Set priority
3. Examples
1) set instruction wc priority
[root@localhost ~] # nice-n 19 wc / / sets the lowest priority for wc
^ Z / / Press the key combination ctrl+z [2] + Stopped nice-n 19 wc
[root@localhost ~] #
2) View process priority
[root@localhost ~] # ps-ao "% p%y%x%c%n" / / View process level, wc level is 19
PID TTY TIME COMMAND NI
8321 pts/0 00:00:00 wc 19
8370 pts/0 00:00:00 ps 0