UNIX Being Nice


I had no idea as to the existance of this command, but as I was searching through my /usr/bin/ directory trying to see what version of Perl I had, I saw the nice command.

Typing man nice gave:

nice — execute a utility with an altered scheduling priority

nice [-n increment] utility [argument …]

nice runs utility at an altered scheduling priority. If an increment is
given, it is used; otherwise an increment of 10 is assumed. The super-
user can run utilities with priorities higher than normal by using a neg-
ative increment. The priority can be adjusted over a range of -20 (the
highest) to 20 (the lowest).

Available options:

-n increment
A positive or negative decimal integer used to modify the system
scheduling priority of utility.

The nice utility shall exit with one of the following values:

1-125 An error occurred in the nice utility.

126 The utility was found but could not be invoked.

127 The utility could not be found.

Otherwise, the exit status of nice shall be that of utility.

The historic -increment option has been deprecated but is still supported
in this implementation.

csh(1), getpriority(2), setpriority(2), renice(8)

The nice utility conforms to IEEE Std 1003.2-1992 (“POSIX.2”).

A nice utility appeared in Version 6 AT&T UNIX.

nice is built into csh(1) with a slightly different syntax than described
here. The form `nice +10′ nices to positive nice, and `nice -10′ can be
used by the super-user to give a process more of the processor.

As a long time previous DOS/Windows user that moved to Mac and BSD back in 2002, I guess its like assigning priority in the Task Manager in NT/2000/XP/2003?

Who cares, I can say UNIX is being nice :)

Author bio and support


Ruben Schade is a technical writer and infrastructure architect in Sydney, Australia who refers to himself in the third person. Hi!

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite bespoke cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or send a comment. Thanks ☺️.