# Netcat missing -q



## Phishfry (Oct 31, 2022)

The netcat manual indicates that `netcat -q` is a valid option flag
But on FreeBSD 12 &13 I get this:

# `nc -q`

```
nc: invalid option -- q
usage: nc [-46DdEFhklNnrStUuvz] [-e policy] [-I length] [-i interval] [-O length]
      [--no-tcpopt] [--sctp]
      [-P proxy_username] [-p source_port] [-s source] [-T ToS]
      [-V rtable] [-w timeout] [-X proxy_protocol]
      [-x proxy_address[:port]] [destination] [port]
```
What is the deal? Is our base netcat different?


----------



## Phishfry (Oct 31, 2022)

I see two netcats in ports. Wondering which contains -q flag.

```
gnetcat-0.7.1_5                GPL'ed re-write of the well known networking tool netcat
netcat-1.10_3                  Simple utility which reads and writes data across network connections
```

I imagine the gnetcat does what i need.
What is the netcat-1.10_3 version in ports? dev version? Solaris version?


----------



## SirDice (Oct 31, 2022)

Phishfry said:


> What is the netcat-1.10_3 version in ports?


I believe that's the "original" netcat source. Everything else, including 'our' nc(1) have been (re)implementations.


----------



## Eric A. Borisch (Oct 31, 2022)

net/netcat is https://sourceforge.net/projects/nc110/ :


> Memorial of original *Hobbit*'s version 1.10 of netcat tool.


By all means install it (_/usr/local/bin/netcat_ via `pkg install netcat`) if it does something you want and can't get with base's (_/usr/bin/nc)_ nc(1).


----------



## Phishfry (Oct 31, 2022)

Neither port contains the -q option.
How strange.


----------



## T-Daemon (Oct 31, 2022)

SirDice said:


> Everything else, including 'our' nc(1) have been (re)implementations.


Apparently 'our' nc(1) comes from OpenBSD:

/usr/src/contrib/netcat/FREEBSD-upgrade

```
nc(1) is very small and most of code are just copied as-is from OpenBSD.  With a
few exceptions:

 * --no-tcpopt: Local feature specific to FreeBSD.
 * -V: We use FIB to map what OpenBSD do for "rdomain"
 * -E, -e: These are mostly self contained IPsec extensions

delphij@FreeBSD.org - Mar 23, 2010
```

And theirs 

```
* Re-written nc(1) for OpenBSD. Original implementation by
 * *Hobbit* <hobbit@avian.org>.
```


----------



## T-Daemon (Oct 31, 2022)

Phishfry, you didn't mention for what purpose you need netcat, but have a look at net/socat, maybe it suits your needs.



			http://www.dest-unreach.org/socat/doc/README


----------



## richardtoohey2 (Oct 31, 2022)

T-Daemon said:


> you didn't mention for what purpose you need netcat


This question is a spin-off for this other question here:









						Web Status Page
					

I would like to have a webpage display sysctl output for OneWire on my local network.  sysctl dev.ow_temp.0.temperature sysctl dev.ow_temp.1.temperature sysctl dev.ow_temp.2.temperature sysctl dev.ow_temp.3.temperature  What are my options? I would like to use a lightweight solution. lighttpd is...




					forums.freebsd.org


----------

