How to Quickly Check If A Port Is Open With netcat

Sometimes you need to check if a port is open and available e.g. not firewalled, from your current location.

The following netcat command will instantly tell you if you a port is open and you can connect to it on a remove server:

netcat -w1 -z -v <HOST> <PORT>


netcat -w1 -z -v 443

If the port is open you’ll get the following response:

$ netcat -w1 -z -v 443 [] 443 (https) open

And if it’s closed:

$ netcat -w1 -z -v 21 [] 21 (ftp): Connection timed out