nc stands for NetCat – arbitrary TCP and UDP connections and listens – as stated in the manual, I love a lot of things written by BSD community, the *BSD itself as well, so this command too.
You can use it very easily to check for remote port like this :
nc -z serverName.net 22 - where nc is the executable, assuming it’s in your $PATH, -z flag stands for : “just scan for listening daemons, without sending any data to them”, serverName.net should be replaced with your server FQDN, and 22 in my case is the port number, you can choose whatever port you want. Here, the netcat will return : Connection to serverName.net 22 port [tcp/ssh] succeeded! – which means that there’s a listener / daemon on the remote side. Soon I will share another approach, in python, for scanning wider range on ports.


