Comment Comment by lma21 To avoid any unwanted matches with grep (e.g. ports 1999 and 19999), use: $ lsof -i:$port | grep LISTEN $ kill $pid parent lma21 3 years ago