How to use a UNIX console app I downloaded a port knocking script from
http://www.zeroflux.org/projects/knock

It downloaded a file knock, which is a Unix Executable File. When I double click on it, it runs the Terminal, where it writes 

Last login: Thu Nov  1 12:19:53 on ttys003
Admins-MacBook-Air-3:~ me$ /Users/me/Desktop/knock ; exit;
usage: knock [options] &lt;host&gt; &lt;port[:proto]&gt; [port[:proto]] ...
options:
  -u, --udp            make all ports hits use UDP (default is TCP)
  -v, --verbose        be verbose
  -V, --version        display version
  -h, --help           this help

example:  knock myserver.example.com 123:tcp 456:udp 789:tcp

logout

[Process completed]


But I would like to run it in Terminal using knock [options]. How do I do that?
First of all, I assume we're referring to the executable downloaded at http://www.zeroflux.org/proj/knock/files/knock-macos.tar.gz.

Most command-line executables like knock aren't designed to be double-clicked on in the Finder. Doing so simply executes the executable with no options, so this isn't what you want.

Instead, open a new Terminal window (using Spotlight or in the Finder from /Applications/Utilities/) and type in something like the following and press return:

/Users/me/Desktop/knock --version

Doing that should print out:

knock 0.5
Copyright (C) 2004-2005 Judd Vinet &lt;jvinet@zeroflux.org&gt;


Basically, when you type that stuff into the Terminal prompt, the Terminal executes /Users/me/Desktop/knock and passes it the --version option.

If you were to type in only the following and press return, you'd get the same "unwanted" output as before:

/Users/me/Desktop/knock