get port number linux code example Example 1: netstat command in linux to check specific port netstat -tulpn | grep :80 Example 2: linux see used ports netstat -tulpn