Kill tomcat service running on any port, Mac using terminal like 8080/ 8005
Asked
Active
Viewed 8,796 times
2
-
Check this [link](https://stackoverflow.com/questions/20239232/django-server-error-port-is-already-in-use) , answer already given on this link. – Barno Chakraborty Aug 25 '21 at 11:22
-
You are right , it's just more about specific keyword mentioned in the question so people can easily relate . – Suraj Shingade Sep 22 '21 at 23:29
2 Answers
7
- Go to Launchpad Type Terminal
- Run the following commands:
For all listening ports
netstat -vanp tcp
Apply port filter
netstat -vanp tcp | grep 8080
Finally, with the PID we can run the following command to kill the process
Copy PID from the result set
kill -9 <PID>
Example: kill -9 1234
Done !!
Find similar answer : Django Server Error: port is already in use

Suraj Shingade
- 2,134
- 4
- 17
- 24
0
Run in terminal:
lsof -n -iTCP:8080 -sTCP:LISTEN -n -l -P | grep 'LISTEN' | awk '{print $2}' | xargs kill -9
lsof -n -iTCP:8005 -sTCP:LISTEN -n -l -P | grep 'LISTEN' | awk '{print $2}' | xargs kill -9

Joakim M
- 1,793
- 2
- 14
- 29