sudo lsof -i -n -P | grep LISTEN

Category: Self-Hosting

sudo lsof -i -n -P | grep LISTEN

List all processes with open listening network ports — map services to ports

Lists all network-listening sockets with their process names and ports in numeric format. A complete picture of what's exposed on the network.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.