nice (Unix)

from Wikipedia, the free encyclopedia
nice
Basic data

developer Bell Laboratories
operating system Unix and Unix systems
category System software

nice is a command from Unix- like operating systems. The program is mapped directly to a system call . With niceit is possible to start a command with a certain priority so that the then executed process receives more or less CPU time than other processes . The nice value is specified as an integer and ranges from −20 to 19: where −20 is the highest priority and 19 the lowest. The value is 0 by default and describes a static priority for each thread.

Use and effect

The use of nicealways makes sense if on multi-user systems such as Unix users want to assign a weighting to their processes. It is thus possible to assign a lower priority and thus a high nice value to a computationally intensive process so as not to impair other users. High priorities, i.e. H. −1 to −20, can only be assigned by the superuser .

To z. B. to run a computationally intensive process like calculating the storage space consumption of the files in a directory (here:) du -s /in the background without affecting other programs, the process can be assigned a higher nice value:

nice -n 19 du -s /

Similar commands

The similar command renicecan be used to change the priority of a running process.

In Linux the command is also ioniceavailable to influence the scheduling of the I / O instead of the CPU time in a similar way .

Individual evidence

  1. nice(2)  -  Debian GNU / Linux system calls man page
  2. nice(1)  -  Debian GNU / Linux Executables or Shell Commands man page
  3. ^ A b Andrew S. Tanenbaum, Herbert Bos: Modern Operating Systems . Ed .: Pearson. 2014, ISBN 978-1-292-06142-9 , 10.3 Proccesses in Linux, p. 747 .
  4. renice(1)  -  Debian GNU / Linux Executables or Shell Commands man page
  5. ionice(1)  -  Debian GNU / Linux Executables or Shell Commands man page