Tag Archives: bash

Test if a port on a remote system is reachable

With telnet:

With bash:

Replace tcp with udp, depending on what you want.

With netcat:

If the port is open, you will get an output of 0. If it’s closed, it’s a 1.

Compare the output of two commands

..without creating a temporary file:

The -y is just to show a side-by-side comparison. Very handy! And the result?

Thanks to my colleague Ingvar for showing me this!