- Andrew Hagedorn
- Articles
- Finding the Process on a Port
Finding the Process on a Port
This is an archive of the random commands I have found useful. You may or may not, but the next time I need them I will know where to find them.
As I am developing across multiple different services I will find that I want to start an application, but something else is sitting on the port. You can track what it is with this command:
function on-port {
lsof -i TCP:$1 | grep LISTEN | awk '{print $2}'
}
Alternatively you can just blindly kill it by wrapping that up:
function kill-on-port {
kill $(on-port $1)
}
Other Posts
Technology
- React SSR at Scale
- TravisCI, TeamCity, and Kotlin
- The Good and the Bad of Cypress
- Scaling Browser Interaction Tests
- Exploring Github Actions
- Scope and Impact
- Microservices: Back to the Future