23
4
There's -k
option in OS X (BSD) version of netcat to keep listening after current connection is completed. However in Debian (GNU?) version this option is missing.
There's -q -1
option to listen forever after EOF appears on stdin but this doesn't do the trick and connections close anyway.
Is there any way to force Debian's netcat to keep listening indefinitely?
1Thank you! Thanks to you I found best version of netcat ever. – Aalex Gabi – 2017-10-20T20:04:25.917
1openbsd-netcat appears to have the
-k
option as well – Andrew Savinykh – 2018-06-19T05:01:18.407Package is
netcat-openbsd
, notopenbsd-netcat
for those who might not click @AndrewSavinykh link – Robin Thoni – 2019-04-08T22:22:59.990