List a used port, e.g. 4000 $ lsof -i tcp:4000 Kill a used port, e.g. 4000 $ kill $(lsof -ti:4000) Hints You might have to use sudo to use any of the commands listed above.