In my previous roles with more devops responsibility I’ve found myself having to kill multiple process with the same name quite frequently and often times I find myself coming back to these chain of commands:
ps aux | grep stupid_process | awk '{print $2}' | xargs sudo kill -9
Now in my development roles I’ve often found myself still leveraging the bash skills I’ve learned quite frequently in my day to day. I want to break down this command down in to its individual pieces and explain how they might be used in other scenarios. So hopefully next time you are aggressively stack overflowing a problem and sees a long chain of bash you can do the same.
So lets start with ps aux
ps
returns a list of current running processes where aux
is 3 separate flags that shows every process running on the system.