2

Kill tomcat service running on any port, Mac using terminal like 8080/ 8005

Suraj Shingade
  • 2,134
  • 4
  • 17
  • 24

2 Answers2

7
  1. Go to Launchpad Type Terminal
  2. 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