Linux运维命令
Posted bigbigwood
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux运维命令相关的知识,希望对你有一定的参考价值。
查找pid的进程号: ps -ef | grep nginx | grep -v grep | awk ‘{print $2}‘
#!/bin/sh . ./common-env.sh shutdownService(){ # Find the service process id sid=`ps -ef | grep $1 | grep -v grep | awk ‘{print $2}‘` if [ -n "${sid}" ]; then echo "Shutdown $1" kill ${sid} else echo "$1 not found" fi } # Shut down all services for service in ${oxx_services[*]} do shutdownService ${service} done
以上是关于Linux运维命令的主要内容,如果未能解决你的问题,请参考以下文章