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

I followed this guide to migrate my amazon image from one zone to another. Everything goes fine, but when i run this command:

netcat -p 9999 -l >/dev/sdf

It shows that the command is not found. Then i tried to use nc instead:

nc -p 9999 -l >/dev/sdf

It seems that nc cannot be run with the combination of -p and -l option. What is the exactly same command i should run on my system in equivalent to "netcat -p 9999 -l >/dev/sdf" ?

i am using "Basic 32-bit Amazon Linux AMI 2011.02.1 Beta" as my primary image. It seems that it's centos based. Any help would be much appreciated.

share|improve this question
up vote 3 down vote accepted

Some nc versions has -p option with different meaning:

-p source_port
             Specifies the source port nc should use, subject to privilege restrictions and availability.  It is
             an error to use this option in conjunction with the -l option.

while another:

-p port      local port number (port numbers can be individual or ranges: lo-hi [inclusive])

In your case, just use nc -l 9999 > /dev/sdf is enough.

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.