One of my favorite Ruby tricks:
> "foo".methods.sort - Object.methods| lsof -i :4327 | awk '{ print $2 }' | tail -n+2 | xargs kill -9 |
One of my favorite Ruby tricks:
> "foo".methods.sort - Object.methods| killportprocs() { | |
| local targetport=${1:?pass in target port} | |
| local pids=$(lsof -i :$targetport | awk '{print $2}' | tail +2) | |
| echo "$pids" | |
| echo $pids | xargs kill -9 | |
| } |