1
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.

プロセス・ジョブを管理する

Posted at

プロセス

ps aux

全ユーザーのプロセスを表示

バックグラウンド

<任意のコマンド> &

文末に&を追加するとバックグラウンドで実行できる。

jobs

バックグラウンドで実行されているジョブのステータスやジョブ番号を確認するには、jobs コマンドを使用できます

プロセス・ジョブの終了

バックグラウンドで実行中のコマンドを終了させるには、kill コマンドを使用します。まず、jobs コマンドを実行して、バックグラウンドで実行中のジョブのリストとジョブ番号を確認します。次に、kill コマンドを使用してジョブを終了します。

  1. jobs コマンドを実行してバックグラウンドジョブのリストとジョブ番号を確認します。例えば、次のように表示されるかもしれません

    [1]+ <任意のコマンド> &
    この場合、ジョブ番号は [1] です

  2. ジョブ番号を使用して kill コマンドでジョブを終了します。
    例えば、ジョブ番号が [1] の場合

    kill %1


    または、PID(プロセスID)を使用しても終了できます。PIDは jobs コマンドを実行して表示されるジョブの情報から取得できます。

    kill PID
    ジョブが終了すると、そのバックグラウンドジョブは停止します。

1
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
1
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?