check firewall port code example Example 1: linux see used ports netstat -tulpn Example 2: netstat check port sudo netstat -plnt