Uğur Kazdal

I'm a Linux Ent. Who loves PHP, Python, Go and So.

Kill all processes on spesific port

» linux

Sometimes you have multiple apps works on same port time to time. For example I use Docker for most of my app developments but sometimes when building laravel app I use php artisan serve –port 80 and all of sudden it runs on next available port which is mostly 81. So I kill all the process on port 80 !

Let’s look at how, first, we need to list all process on a spesific port in this case 80.

lsof -t -i :80

You can kill process one by one. But hey, we are on Linux so we need to have some tricks to automatize anything.

kill $(lsof -t -i :80)

OMG. All of sudden. Port 80 is all free !

Related Posts