DEV Community

Discussion on: What do you Google EVERY. SINGLE. TIME. and never just memorize?

Collapse
 
_bigblind profile image
Frederik 👨‍💻➡️🌐 Creemers

How to find out which process is listening on a certain point on my mac. I'm often switching between projects, and have a server from another project running on a port that I now need for another server.

And it looks like Heroku's CLI doesn't always stop all processes correctly when you stop it using ctrl+c

Collapse
 
palle profile image
Palle • Edited

You could add a function to your .bashrc to make this easier:

listening() {
    lsof -n -iTCP:$1 | grep LISTEN
}

Then (after restarting your terminal or typing source ~/.bashrc) type listening 8080 to find out what process is blocking that port.