Kill a process running on port

diff

kill -9 $(lsof -i :<port> | awk '{l=$2} END {print l}')

click the source code to copy install diff on any operating system with command-not-found.com