Skip to content

Instantly share code, notes, and snippets.

@schigh-ntwrk
Created March 15, 2023 22:15
Show Gist options
  • Save schigh-ntwrk/db2f1ce19b7640ccff0dbad278ad9be9 to your computer and use it in GitHub Desktop.
Save schigh-ntwrk/db2f1ce19b7640ccff0dbad278ad9be9 to your computer and use it in GitHub Desktop.
MacOS zshell func to show who is using what port (not mine, but i forgot where I stole it from)
# check to see who is using what port
function macnst (){
netstat -Watnlv | grep LISTEN | awk '{"ps -o comm= -p " $9 | getline procname;colred="\033[01;31m";colclr="\033[0m"; print colred "proto: " colclr $1 colred " | addr.port: " colclr $4 colred " | pid: " colclr $9 colred " | name: " colclr procname; }' | column -t -s "|"
}
@schigh-ntwrk
Copy link
Author

Screenshot 2023-03-15 at 6 16 54 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment