Find in use ports
Find what program is using a port
lsof -i :8080
Prints
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
node 22208 user 20u IPv4 0xc276a8f2b74737c2 0t0 TCP localhost:appserv-http (LISTEN)
node 22208 user 24u IPv4 0xc3478a4e25fbb40 0t0 TCP localhost:appserv-http->localhost:61372 (ESTABLISHED)
Google 93247 user 41u IPv4 0xf270b3b647faf5ad 0t0 TCP localhost:61372->localhost:appserv-http (ESTABLISHED)
Find all in use ports:
lsof -i -P -n
Only TCP on a port
lsof -i TCP:8080