Checking if a port is open
However, if you only want to see a specific service name or port, you can use the netstat command with the option above with grep… Example below shows you to scan for open ports and only list port 22.. sudo netstat -tnlp | grep :22. You should see similar line as below: