how to check if a port is open in 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