Filter processes by string pattern (let it be “java” processes):
1 |
ps -eaf | grep java |
Find my process in resulted list and kill by id:
1 |
kill -9 123 |
Kill all processes by “java” pattern:
1 |
kill -9 `ps -eaf | grep java | grep -v grep | awk '{print$2}'` |