Is anybody else not able to get nc -lp 8888 working on Mac OS X? Is there another way to get this to work?
4 Answers
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.
Here's how this is working for me on OS X 10.10, with either the installed BSD version, or the one from Homebrew:
BSD Version
When using the BSD version that ships with OS X, a server can be started like this
/usr/bin/nc -l 9999Homebrew
- Install using Homebrew:
brew install netcat - This will install v0.7.1 of
- One can use either the
ncornetcatcommand.ncis an alias fornetcat.
To start a server:
nc -l -p 9999To start a client:
nc targethost 9999To get the manpage of this version, one needs to use man netcat, as man nc will open the manpage of the BSD version.
I needed to test a web service over SSL, which ncat (made by the nmap team) supports.
brew install nmap
ncat -C --ssl api.somecompany.com 443 nc on MacOS has too many bugs, and Apple did none patch for years. the netcat from homebrew is a very low version. use ncat from nmap instead
3