We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Working with ports
almirsarajcic
0 comments
Copy link
Sometimes you need to find out which ports you have open, find a process listening on a specific port, or even kill the process. Here’s how.
# Find all open ports
lsof -i 4 -a | grep LISTEN
# Find the process that's listening on a specific port
lsof -i :5432
# Find the process and kill it
lsof -i :5432 | awk '{print($2)}' | xargs -I '{}' kill -9 {}
We’ve used this in Backing up Fly.io PostgreSQL DB with a one-liner.
copied to clipboard
Comments (0)
Sign in with GitHub to join the discussion