Shell脚本关闭Nginx进程

[root@centos00 ~]# ps -ef | grep nginx
root 6682 1 0 18:30 ? 00:00:00 nginx: master process sbin/nginx
nobody 6801 6682 0 18:46 ? 00:00:00 nginx: worker process
root 7104 4224 0 20:17 pts/4 00:00:00 grep nginx
[root@centos00 ~]# ps -ef | grep nginx | grep -v grep
root 6682 1 0 18:30 ? 00:00:00 nginx: master process sbin/nginx
nobody 6801 6682 0 18:46 ? 00:00:00 nginx: worker process
[root@centos00 ~]# ps -ef | grep nginx | grep -v grep | awk '{print $2}'
6682
6801
[root@centos00 ~]# ps -ef | grep nginx | grep -v grep | awk '{print $2}' | xargs kill -9

  

posted @ 2020-07-26 19:20  初入门径  阅读(734)  评论(0)    收藏  举报