shell獲取nginx工做進程數量和進程號

#!/bin/sh worker_num=`ps -ef|grep nginx|grep worker|wc -l`; echo $worker_num worker_id=`ps -ef|grep nginx|grep worker|awk '{print $2}'`  for id in $worker_id do echo $id done
相關文章
相關標籤/搜索