Created
August 13, 2024 15:10
-
-
Save siberex/cd095024277c222781a6ca1bd443c8c0 to your computer and use it in GitHub Desktop.
macos_open_ports.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://x.com/seldo/status/1823126087423099192 | |
sudo lsof -iTCP -sTCP:LISTEN -n -P | awk 'NR>1 {print $9, $1, $2}' | sed 's/.*://' | while read port process pid; do echo "Port $port: $(ps -p $pid -o command= | sed 's/^-//') (PID: $pid)"; done | sort -n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment