nc: invalid option -- 'z'

Patan picture Patan · Aug 1, 2016 · Viewed 12.7k times · Source

On RHEL 7.2 OS, I get following error when trying to run nc commnad

nc -z -v -w1 host port
nc: invalid option -- 'z'
Ncat: Try `--help' or man(1) ncat for more information, usage options and help. QUITTING.

Is there any alternative to it

Answer

Venusor picture Venusor · Jan 4, 2018

maybe nc is a link to ncat, use the commands to check:

which nc | xargs ls -l

if the nc is linked to ncat,you should relink nc to netcat, if netcat is not installed, refer the website:http://netcat.sourceforge.net/download.php