Cheatsheet: Find Listening Ports

Using lsof

Find the process listening on a specific port

lsof -i :<port_number>

List all network connections and listening processes

lsof -i -P -n

Using netstat

Find the process ID and details for a specific port

netstat -anp | grep <port_number>

List all listening processes

netstat -tuln

Using ss

Find details about a specific port

ss -tuln | grep <port_number>

List all listening processes

ss -tuln

Using fuser

Find the process using a specific port

fuser <port_number>/tcp