bash script

add to .bashrc/.zshrc

function kill-port(){
  lsof -ti :$1 | xargs kill
}

then:

~ kill-port 3000