I want to use ps -ef | grep \"keyword\" to determine the pid of a daemon process (there is a unique string in output of ps -ef in it).
ps -ef | grep \"keyword\"
I can kill the pr
To kill a process by a specific keyword you could create an alias in ~/.bashrc (linux) or ~/.bash_profile (mac).
~/.bashrc
~/.bash_profile
alias killps="kill -9 `ps -ef | grep '[k]eyword' | awk '{print $2}'`"