how to check which port is open in ubunut 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