「分かりそう」で「分からない」でも「分かった」気になれるLinuxコマンド辞典イメージぴよ画像「分かりそう」で「分からない」でも「分かった」気になれるLinuxコマンド辞典

renice

スポンサーリンク

何するコマンド?

実行しているプログラムの優先度を変えるときに使うコマンド



書き方

renice [優先度] [プロセスID]

renice [優先度] [オプション]

renice [オプション] [プロセスID]

renice [オプション]



オプション

オプション説明
-n【優先度】優先度を指定する
Specify the scheduling priority to be used for the process, process group, or user. Use of the option -n or --priority is optional, but when used it must be the first argument.
--priority【優先度】優先度を指定する
Specify the scheduling priority to be used for the process, process group, or user. Use of the option -n or --priority is optional, but when used it must be the first argument.
-g【プロセスグループID変更対象のプロセスグループを指定する
Force the succeeding arguments to be interpreted as process group IDs.
--pgrp【プロセスグループID】変更対象のプロセスグループを指定する
Force the succeeding arguments to be interpreted as process group IDs.
-u【ユーザID】変更対象のユーザを指定する
Force the succeeding arguments to be interpreted as usernames or UIDs.
--user【ユーザID】変更対象のユーザを指定する
Force the succeeding arguments to be interpreted as usernames or UIDs.
-p【プロセスID】変更対象のプロセスを指定する
Force the succeeding arguments to be interpreted as process IDs (the default).
--pid【プロセスID】変更対象のプロセスを指定する
Force the succeeding arguments to be interpreted as process IDs (the default).
-hヘルプを表示する
Display a help text.
--helpヘルプを表示する
Display a help text.
-vバージョン情報を表示する
Display version information.
--versionバージョン情報を表示する
Display version information.

補足事項

例えば

renice 3 6590

を実行すると、プロセスIDが「6590」のプロセスの優先度が「3」になります。

これは、優先度を指定する「-n」オプションや対象のプロセスを指定する「-p」オプションを指定した場合と同じです。

renice 3 6590

renice -n 3 6590

renice 3 -p 6590

renice -n 3 -p 6590

は、すべて同じ結果になります。

「-u」オプションを指定すると、指定ユーザのプロセスの優先度を一括で変更できます。
例えば

renice 3 -u root



renice -n 3 -u root

を実行すると、ユーザ「root」のプロセスの優先度が、すべて「3」になります。

「-g」オプションは変更対象のプロセスグループを指定するときに使うオプションです。

renice 3 -g 5954

を実行すると、プロセスグループIDが「5954」のプロセスの優先度が、すべて「3」になります。

スポンサーリンク


書籍画像