I am using Ubuntu server 16.04.3, it comes with the OpenBSD version of netcat.

I have used the OpenBSD version of netcat before in Fedora, and in Fedora I can't use the -p option with the -l option, for example the following is illegal:

nc -l -p 12345

But in Ubuntu server 16.04.3, the above command worked (by "worked", I mean netcat started listening)!

Even though man nc on Ubuntu server 16.04.3 itself says that it is illegal:

enter image description here

Why is this happening?!


1 Answer 1


This is happening because the Debian/Ubuntu version of "netcat-openbsd" is not in fact the OpenBSD code. It is the OpenBSD code significantly patched with Debian/Ubuntu changes, which have not been sent back to the maintainers of the original software.

One of those changes, written by Debian person Aron Xu, makes it possible to use the -p option with the -l option. As is alas usual, this patch is a half-done job, and does not fix the doco to match the program.

With the vanilla programs, this is impossible, as documented.

Further reading

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.