Show open ports and what program is using them

netstat -lptn

Alternatively you can use:

netstat --tcp --listening --programs --numeric

Common uses

  • See what ports are open on your system
  • See what processes the open ports belong to
  • Security audits to find unused software

One thought on “Show open ports and what program is using them

  1. ahmet ertugrul

    I am biding my socket to ‘192.168.1.108’ YET the list generated by above command shows:

    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 127.0.1.1:6958 0.0.0.0:* LISTEN 930/python3

    AND 127.0.1.1 is not reachable from any other RPi’s in my network

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Markdown is allowed in comments.