Sometimes you need to be able to quickly kill a number of processes on the server that all share the same name.
killcli () {
kill -9 `ps ax | grep cli.php | grep -v grep | awk '{print $1}'`
}
Place the function inside your ~/bashrc file and then call the function name from the commandline. In this example we’d call:
# killcli