Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I downloaded a port knocking script from

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] <host> <port[:proto]> [port[:proto]] ...
  -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 123:tcp 456:udp 789:tcp


[Process completed]

But I would like to run it in Terminal using knock [options]. How do I do that?

share|improve this question
So you want to run knockd locally to allow remote access to your MBA? – patrix Nov 1 '12 at 13:04
And there is neither a knockd nor a knock --daemon for OSX in the downloaded package, it's only the client. – patrix Nov 1 '12 at 13:23
yes, i wanted only the client – Peter Lapisu Nov 5 '12 at 17:27
up vote 4 down vote accepted

First of all, I assume we're referring to the executable downloaded at

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 <>

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:


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.