LoginSignup
12
16

More than 5 years have passed since last update.

実行中プロセスの確認

Posted at

すぐ忘れるのでメモ。
たとえば、"python"関連の実行プロセスがあるかどうか確認したいとき。
以下の二つの方法を記載する。

1.pgrep
2.ps

1. pgrep使用

#pgrep 検索したい実行プロセス
#-l は実行プロセスも同時に出力するオプション

$ pgrep -l python

2.ps 使用

#ps で実行プロセスの表示
#a:自分以外のユーザーのプロセスも表示する
#u:ユーザー名と開始時刻を表示する
#x:実行中のプロセスだけ表示する
#全出力した実行プロセスのなかから、grepで"python"が含まれるプロセスのみを抽出

$ ps aux | grep "python"

psのオプションは他にもたくさんあるのでその時々に応じて。

12
16
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
12
16