Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is anybody else not able to get nc -lp 8888 working on Mac OS X? Is there another way to get this to work?

share|improve this question
    
How does it not work? Does it return an error? –  heavyd Mar 3 '10 at 1:58
    
I am not near a mac right now, but it returns the useage. nc -lp 8888 works on my Ubuntu box. –  kzh Mar 3 '10 at 15:50
add comment

1 Answer

up vote 9 down vote accepted

It looks to me as if the -p option does nothing on the OS X version of netcat. To get it to work, I must do nc -l localhost 8888.

share|improve this answer
2  
Unless installed from homebrew, then nc -l -p 8888 works. –  user1338062 Dec 3 '12 at 13:27
1  
From man nc: -l ... It is an error to use this option in conjunction with the -p, -s, or -z options. ... You probably want to just stick with @kzh's command there –  fatuhoku Oct 11 '13 at 18:41
    
@fatuhoku I just checked my manual, and yest it does say that in there, but the weird thing is that if I do nc -lp 8888 or nc -l -p 8888 it will then take -p to mean listening port. So my distributed copy does not listen to its own manual! –  kzh Oct 11 '13 at 20:31
    
Agreed! Flags are a bit too expressive... it should have just refused to do any useful work, output a message and quit! –  fatuhoku Oct 11 '13 at 21:02
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.