手册页部分 1: 用户命令

退出打印视图

更新时间: 2014 年 7 月
 
 

nice(1)

名称

nice - 调用命令并更改调度优先级

用法概要

/usr/bin/nice [-increment | -n increment] command [argument]...
/usr/xpg4/bin/nice [-increment | -n increment] command [argument]...

csh Builtin

nice [-increment | +increment] [command]

描述

nice 实用程序调用 command,并请求其以不同的系统调度优先级运行。priocntl(1) 命令是更通用的调度程序功能接口。

调用进程(一般为用户的 shell)必须属于支持 nice 的调度类。

如果使用了 C shell(请参见 csh(1)),则必须指定命令的完整路径。否则,将调用 csh 内置的 nice 版本。请参见下文的“csh Builtin”部分。

/usr/bin/nice

如果 nice 执行命令时使用参数,则使用缺省的 shell /usr/bin/sh(请参见 sh(1))。

/usr/xpg4/bin/nice

如果 nice 执行命令时使用参数,则使用 /usr/xpg4/bin/sh(请参见 ksh88(1))。

csh Builtin

nice 也是一个 csh 内置命令,其行为不同于实用程序版本。有关说明,请参见 csh(1)

选项

支持以下选项:

increment | –n increment

increment 是一个正的或负的十进制整数,它会影响实用程序的执行,就像实用程序调用了采用 increment 选项参数数值的 nice() 函数一样。请参见 nice(2)nice() 错误将被忽略,但 EINVAL 除外。如果不指定,则采用增量 10

通过使用负增量(如 –10),超级用户可以用高于正常优先级的优先级运行命令。非特权用户指定的负 increment 将被忽略。

操作数

支持下列操作数:

command

要调用的命令的名称。如果 command 指定了任何特殊的内置实用程序(请参见 shell_builtins(1)),将会产生无法预料的结果。

argument

在调用 command 时作为参数提供的任何字符串。

环境变量

有关影响 nice 执行的以下环境变量的描述,请参见 environ(5):LANG、LC_ALL、LC_CTYPE、LC_MESSAGES、PATH 和 NLSPATH。

退出状态

如果调用 command,则 nice 的退出状态将是 command 的退出状态。否则,nice 将以下列值之一退出:

1-125

出现错误。

126

找到了 command,但无法调用。

127

找不到 command

属性

有关下列属性的说明,请参见 attributes(5)

/usr/bin/nice

属性类型
属性值
可用性
system/core-os
CSI
Enabled(已启用)

/usr/xpg4/bin/nice

属性类型
属性值
可用性
system/xopen/xcu4
CSI
Enabled(已启用)
接口稳定性
Committed(已确定)
标准
请参见 standards(5)

另请参见

csh(1)ksh88(1)nohup(1)priocntl(1)sh(1)shell_builtins(1)nice(2)attributes(5)environ(5)standards(5)