문제

I'm getting a "socket.error: No socket could be created" when running a web.py script.

Is there a way to kill all processes on running on port 8080 (or any other port I wish) with a single line in Terminal on OSX Mavericks?

도움이 되었습니까?

해결책

It's a single line, but you'd need to put it into a shell alias or shell script in order to make it easy to use:

$ kill $(lsof -i tcp:8080 | tail -n +2 | awk '{ print $2 }')

If you want to see and kill processes that don't belong to you, then sudo needs to get involved:

$ sudo kill $(sudo lsof -i tcp:8080 | tail -n +2 | awk '{ print $2 }')

다른 팁

The best way to kill all proccesses running on port 8080 in ubuntu is:

sudo fuser -k 8080/tcp

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top