A small utility script to check for open ports using TCP.

Taken from StackOverflow and wrapped inside a little function.


Clone this repository to some place on your computer.

$ cd ~/github
$ git clone git@github.com:kevingimbel/portcheck.git

Then make the script executable and link it somewhere into your $PATH.

$ chmod +x portcheck
$ (sudo) ln -s /full/path/to/portcheck /usr/local/bin/

Now you can run portcheck -v to see if it was installed correctly.


Call the script and pass --host and --port as parameter.

$ portcheck --host mywebsite.com --port 80
$ portcheck --host 123.456.789 --port 22