nice - 调用命令并更改调度优先级
/usr/bin/nice [-increment | -n increment | --adjustment=increment] command [argument]...
/usr/bin/nice
/usr/xpg4/bin/nice [-increment | -n increment] command [argument]...
nice [-increment | +increment] [command]
nice 实用程序调用 command,并请求其以不同的系统调度优先级运行。priocntl(1) 命令是更通用的调度程序功能接口。
调用进程(一般为用户的 shell)必须属于支持 nice 的调度类。
If the C shell (see csh(1)) is used, the csh built-in version of nice will be invoked unless the full path of the nice utility is specified.请参见下文的“csh Builtin”部分。
如果 nice 执行命令时使用参数,则使用缺省的 shell /usr/bin/sh(请参见 sh(1))。
如果 nice 执行命令时使用参数,则使用 /usr/xpg4/bin/sh(请参见 ksh88(1))。
nice 也是一个 csh 内置命令,其行为不同于实用程序版本。有关说明,请参见 csh(1)。
不带任何选项时,nice 实用程序报告当前进程的 nice 级别。
支持以下选项:
increment 是一个正的或负的十进制整数,它会影响实用程序的执行,就像实用程序调用了采用 increment 选项参数数值的 nice() 函数一样。请参见 nice(2)。nice() 错误将被忽略,但 EINVAL 除外。如果不指定,则采用增量 10。
Running commands with priority higher than normal by using a negative increment such as -10 requires the {PRIV_PROC_PRIOCNTL} privilege.非特权用户指定的负 increment 将被忽略。
显示用法消息并退出。
支持下列操作数:
要调用的命令的名称。如果 command 指定了任何特殊的内置实用程序(请参见 shell_builtins(1)),将会产生无法预料的结果。
在调用 command 时作为参数提供的任何字符串。
有关影响 nice 执行的以下环境变量的说明,请参见 environ(7):LANG、LC_ALL、LC_CTYPE、LC_MESSAGES、PATH 和 NLSPATH。
如果调用 command,则 nice 的退出状态将是 command 的退出状态。否则,nice 将以下列值之一退出:
出现错误。
找到了 command,但无法调用。
找不到 command。
有关下列属性的说明,请参见 attributes(7):
|
|
csh(1), ksh88(1), nohup(1), priocntl(1), renice(1), sh(1), shell_builtins(1), nice(2), attributes(7), environ(7), privileges(7), standards(7)
Support for the --adjustment and --help options, as well as for running nice with no options to print the current level, were added to the Solaris nice command in Oracle Solaris 11.4.0.
The –n option and /usr/xpg4/bin/nice command were added to Solaris in Solaris 2.5.
The nice command has been included in all versions of SunOS & Solaris.