Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer

up vote 2 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
add comment

Your Answer

 
discard

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.