Issue
For e.g. if we have to check all the glassfish processes running we run the following command:
ps aux | grep glassfish
Now for e.g. it returns 4 processes that glassfish is occupying is there a way to edit the command and store it in bash_profile that it will kill all the processes that were the output of running the ps aux | grep glassfish
For e.g. if I store an alias in bash_profile as killglass then it should kill all the processes that were returned when I run the ps aux | grep glassfish command from the terminal
I am run MAC(Yosemite)
Thanks in advance
Solution
You can use
pkill -f "glassfish"
Instead of ps aux and grep
Answered By - gidim