niceのススメ

niceって何?

NAME
       nice - run a program with modified scheduling priority

SYNOPSIS
       nice [OPTION] [COMMAND [ARG]...]

優先順位を指定してコマンドを実行するためのコマンド。

サンプル

例えば、

古いバックアップファイル(けっこう大量)を削除しちゃお。けど、あまり負荷かけたくないなぁ。

って時なんかにこんな感じで使う。

nice -n 19 rm -r path-to-backup-dir/old/ &

*1

オプションとか

詳しくはman参照。

DESCRIPTION
       Run  COMMAND  with an adjusted niceness, which affects process scheduling.  With no COMMAND, print the
       current niceness.  Nicenesses range from -20 (most favorable scheduling) to 19 (least favorable).

       -n, --adjustment=N
              add integer N to the niceness (default 10)

       --help display this help and exit

       --version
              output version information and exit

備考

スーパーpre記法(シンタックス・ハイライト)って、manも対応してるのね。

*1:「&」はbackgroundで実行