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?

[Linux][command] プロセス管理_実行_nice, renice, nohup

Last updated at Posted at 2025-03-22

niceコマンド

# nice [オプション] コマンド
オプション 英語の由来 説明
default nice デフォルトの優先度(通常は10)でコマンドを実行します。
-n nice値
-nice値
niceness 実行するコマンドのnice値(優先度)を指定します。値が高いほど優先度が低く、値が低いほど優先度が高い。

使用例

優先度(正)

# nice -n 15 tar czf home_backup.tar.gz /home

or 

# nice -15 tar czf home_backup.tar.gz /home

優先度(負)←rootユーザーのみ

# nice -n -10 tar czf home_backup.tar.gz /home

or

# nice --10 tar czf home_backup.tar.gz /home

reniceコマンド

# renice nice値 [オプション]
オプション 英語の由来 説明
default re-nice 実行中プロセスのnice値(優先度)を変更します。
-p <PID>
<PID>
process 対象とするプロセスID(PID)を指定します。
- 省略可能
-u <ユーザー名> user 対象とするユーザーを指定します。
- ユーザーが所有するすべてのプロセスのnice値を変更

使用例

優先度を低くする

# renice 15 -p 1234

or

# renice 15 1234

優先度を高くする←rootユーザーのみ

# renice -10 -p 1234

or

# renice -10 1234

nohupコマンド

# nohup コマンド [引数] &
コマンド例 説明
nohup ./script.sh & script.shをバックグラウンドで実行し、ターミナルを閉じてもプロセスが継続します。

Ping-t

nice

renice

nohup

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?