Skip to content

Instantly share code, notes, and snippets.

@danielneal
Created October 26, 2017 08:13
Show Gist options
  • Save danielneal/17c493b6ffc4b4bbb899e7d38192b30c to your computer and use it in GitHub Desktop.
Save danielneal/17c493b6ffc4b4bbb899e7d38192b30c to your computer and use it in GitHub Desktop.
portpid
# Show the process that is listening on the port
portpid () {
lsof -i 4tcp:$1 -sTCP:LISTEN -Fp | cut -c 2-
}
# thanks @bronsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment