Here is they dude with the answers: http://spiritofnine.com/2008/03/28/how-to-show-open-ports-on-os-x/
Short answer:
sudo lsof -i -P | grep -i listen
home | blog | Terrible people and places | Covid-19 links | Teh Internet | guest blog |rants | placeholder | political | projects | Gwen and Liam | Citadel patched | Tools | Scouts
sudo lsof -i -P | grep -i listen