port 8080 already in use mac code example
Example 1: mac error that port is already in use
sudo lsof -t -i tcp:8000 | xargs kill -9
Example 2: mac find who is using port 8080
$ lsof -i :8080 | grep LISTEN
or
$ ps -ef 42975
sudo lsof -t -i tcp:8000 | xargs kill -9
$ lsof -i :8080 | grep LISTEN
or
$ ps -ef 42975