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.


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.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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