kill all process running on a port code example
Example 1: kill process on port
lsof -i:8080
kill $(lsof -t -i:8080)
kill -9 $(lsof -t -i:8080)
Example 2: kill all process at port
lsof -ti tcp:2525 | xargs kill
Example 3: kill port
kill -9 $(lsof -t -i:8080)
Example 4: kill port
kill -9 $(sudo lsof -t -i:'portName')
//Ex. if portname is 3000
//then we will execute "kill -9 $(sudo lsof -t -i:3000)"
Example 5: kill process running on port 80
$: sudo lsof -i tcp:80
$: sudo lsof -t -i tcp:80 | sudo xargs kill