LoginSignup
10
11

More than 5 years have passed since last update.

指定したpidのプロセスが存在するかチェック

Last updated at Posted at 2013-01-01
  • 方法1
[ -x /proc/$PID ]
echo $? # 0 if exists, 1 otherwise
  • 方法2
ps ho pid p $PID > /dev/null
echo $? # 0 if exists, 1 otherwise
10
11
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
10
11