Which port is designed to tell you which app is using a specified port ether with UTP or TCP. This is designed to work on MacOS only.
Add the above function to your startup script i.e. ~/.profile
or your ~/.zshrc
. Consult the documentation for your shell
if you aren't using bash
or zsh
.
Just run whichPort <PORT>
and it will out put whatever application is using them, or the text
"Nothing is using <UTP|TCP>. port ".
i.e
whichPort 8080
which would output something like
Code H 6154 dotmh 38u IPv6 0xddd9c27584710d91 0t0 TCP *:8080 (LISTEN)
Nothing is using UDP Post 8080