Go to main content

マニュアルページ セクション 1: ユーザーコマンド

印刷ビューの終了

更新: 2022年7月27日
 
 

nice(1)

名前

nice - コマンドを変更されたスケジューリング優先度で実行

形式

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

csh Builtin

nice [-increment | +increment] [command]

説明

nice ユーティリティーは、異なるシステムのスケジューリング優先度で動作するように command を実行します。priocntl(1) コマンドは、スケジューラ機能とのより汎用的なインタフェースです。

起動するプロセス (通常は、ユーザーのシェル) は、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 組み込みコマンド」を参照してください。

/usr/bin/nice

nice が引数のあるコマンドを実行する場合、デフォルトのシェル /usr/bin/sh が使われます (sh(1) 参照) 。

/usr/xpg4/bin/nice

nice が引数のあるコマンドを実行する場合は、/usr/xpg4/bin/sh が使用されます (ksh88(1) を参照)。

csh Builtin

nice という csh の組み込みコマンドもあります。こちらの動作は、ここで説明した nice とは異なります。詳しくは csh(1) を参照してください。

オプション

オプションなしの場合、nice ユーティリティーは現在のプロセスの nice レベルを報告します。

サポートしているオプションは、次のとおりです。

increment | –n increment |
––adjustment=increment

increment は正または負の 10 進整数です。このオプションは、ユーティリティーバージョンの実行時に、nice() 関数に increment オプション引数 (数値) を指定して呼び出した場合と同じ効果を発揮します。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.特権を持たないユーザーが負数の増分値を指定した場合は無視されます。

––help

使用方法に関するメッセージを表示して終了します。

オペランド

次のオペランドがサポートされています。

command

呼び出すコマンドの名前。command に組み込みコマンド (shell_builtins(1) を参照) を指定した場合、処理の結果は保証されません。

argument

command を呼び出す際に引数として与える文字列。

環境変数

nice の実行に影響を与える次の環境変数についての詳細は、environ(7) を参照してください。LANG、LC_ALL、LC_CTYPE、LC_MESSAGES、PATH、および NLSPATH。

終了ステータス

command で指定したコマンドが呼び出された場合、そのコマンドの終了ステータスが nice の終了ステータスとなります。呼び出されなかった場合には、nice は次の終了ステータスを返します。

1-125

エラーが発生しました。

126

command で示すコマンドユーティリティーは見つかったが呼び出すことができなかった。

127

コマンドが見つからなかった。

属性

属性についての詳細は、マニュアルページの attributes(7) を参照してください。

/usr/bin/nice

属性タイプ
属性値
使用条件
system/core-os
CSI
有効
インタフェースの安定性
確実

/usr/xpg4/bin/nice

属性タイプ
属性値
使用条件
system/xopen/xcu4
CSI
有効
インタフェースの安定性
確実
標準
standards(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)

History

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.