Port Wars: Hunt Down and Terminate Rogue Processes!

linuxcodesnippet
December 23, 2024
1 min read
0

On macOS use the command lsof -i with the port number to find out what is running on a specific port.

sudo lsof -i :<portnumber>

> This will work for linux as well ;)

Kill the process running on a specific port

use the kill command with the -9 option and the port PID number to kill a process

kill -9 <pid>
Vikramaditya Singh

Vikramaditya Singh

Software engineer III at Oracle. I build high-performance web applications and write about the intersection of software engineering and human creativity.

View Portfolio →

You Might Also Like