How to check listening ports on MacOS
On macOS Big Sur
and later, use this command:
sudo lsof -i -P | grep LISTEN
or to just see just IPv4:
sudo lsof -nP -i4TCP:$PORT | grep LISTEN
分享 . 快乐
On macOS Big Sur
and later, use this command:
sudo lsof -i -P | grep LISTEN
or to just see just IPv4:
sudo lsof -nP -i4TCP:$PORT | grep LISTEN