Server Fault is a question and answer site for system and network administrators. 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

netcat -ul -p2115 fails with a usage statement. What am I doing wrong?


share|improve this question
up vote 23 down vote accepted

To quote the nc man page:

 -l      Used to specify that nc should listen for an incoming connection rather than initiate a connection to a remote host.  It is an error to use this
         option in conjunction with the -p, -s, or -z options.  Additionally, any timeouts specified with the -w option are ignored.

The key here is that -p cannot be combined with the -l flag. When using the -l flag, any ports specified in the positional arguments are used. So instead, you could use the following:

netcat -ul 2115


share|improve this answer

-p might be wrong.. This will work on redhat based distros..

nc -u -l 2115
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.