how to check open port ubuntu code example Example 1: ubuntu open port sudo ufw allow 1191/tcp Example 2: see what is using a port ubuntu $ sudo lsof -i:22