Sep 19, 2018

How to kill many processes at once

ps -ef | grep java | awk '{print $2}' | xargs kill -9
Or
pgrep java  | xargs kill -9

If you need to sudo:

sudo pkill `pgrep -u i88ca java`
Or
for n in $(ps -u i88ca | grep java | cut -d ' ' -f 2); do sudo kill $n; done