unix – use ps and grep to kill processes [solved]

To kill specific processes in one go, use below syntax:

kill $(ps aux | grep '[m]y_specific_process' | awk '{print $2}')

Note: using ‘[]’ is a hack to prevent grep process from being included in returned output


Post a Comment

Your email is never published nor shared. You're allow to say what you want...