Have you ever wanted to test (from the command line) whether a port on another machine can be reached from yours? When some app of your can't seem to connect to a given port, you may want to test things from the command line. (The problem may be that the service using that port has stopped or is blocked by a firewall--it may be that you're mistaken in the port you are trying to use, or perhaps even the ip address, domain name, or machine name.)
There are in fact many tools which can help with this task, some of which will be familiar to those on *nix systems, but Windows users who've been around a while (or who learned from such folks) may try to rely on the good ol' telnet command (as in telnet [machine] [port]). Unfortunately, they often find out how Microsoft has disabled that tool by default for over a decade (since Windows Vista), and while it can be easily enabled, they may be prevented or understandably reluctant to do that.
In this post, I want to show a couple of command-line alternatives which can do the job easily, one best suited for powershell users (Test-NetConnection), and and two of which would suit those who prefer the command line (cmd) and which are now built-into Windows (the past few years): ssh and curl. No, this is not their primary job but they will suit for this task and it may surprise some to learn they're even built-in options. I'll conclude with still other options available to those on *nix environments (who of course can also use ssh and curl), especially nc (netcat).
[....Continue Reading....]