I want to ssh on a remote machine and kill all java process on that machine. I have authorized this machine to ssh on without password so I use command:
ssh remote "kill -9 `pgrep java`"
but I got:
bash: line 0:kill (23779) -No such process
How can I fix it?