Skip to content

Instantly share code, notes, and snippets.

@sh1nj1
Created July 19, 2023 02:22
Show Gist options
  • Save sh1nj1/e88812b85f2cf323b5c71127af5fed7c to your computer and use it in GitHub Desktop.
Save sh1nj1/e88812b85f2cf323b5c71127af5fed7c to your computer and use it in GitHub Desktop.
Get PID by listening port number in Mac OS X
#!/bin/sh
lsof -nP -iTCP -sTCP:LISTEN | grep $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment