0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

niceコマンドとは

プロセスの相対優先度を変更して実行するコマンド

書式
nice [オプション] [実行したいコマンドとそのオプション]

・優先度(nice値)は-20から19の値で調整でき、マイナスに行くほど優先度が高くなり、プラスに行くほど優先度が低くなる

・優先度を高くするにはroot権限が必要

優先度 備考
高  -20 rootユーザでのみ変更可能
↕︎ 0 初期値
19 rootユーザ、一般ユーザで変更が可能
使用例
nice -n -5 /opt/hogehoge.sh

#変更できたか確認
ps -l 
PID  USER PR NI VIRT  RES  SHR  S %CPU %MEM TIME+   COMMAND 
2818 root 15 -5 13004 1416 1208 S 0.0  0.3 0:00.05 /bin/bash /opt/hogehoge.sh

#NIが-5になっていれば変更完了

※ -n 優先度を指定する 

大量のデータをエクスポートしたりバッチ処理の時にしようするとよさそうですね。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?