LoginSignup
7
7

More than 5 years have passed since last update.

psコマンドからプロセスIDを取得する

Last updated at Posted at 2016-07-16

ローカルの場合

ps -ef | grep name | grep -v grep | awk '{ print $2 }'

リモートの場合

awkのパラメータをエスケープする必要がある
ssh user@remotehost "ps -ef | grep name | grep -v grep | awk '{ print \$2 }'"

参考

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