Trying to kill
very process related to Java. Is there a way to use pipe for it? I have tried
ps -e|grep "java"|kill
and
ps -e|grep "java"|xargs kill
Neither works.
pgrep is the right tool for grepping processes:
kill $(pgrep -f java)
the -f
flag in pgrep is for matching against the full command line used to execute a process.
There is, but this is easier (presuming your system has killall
):
killall java
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With