Become a MacRumors Supporter for $25/year with no ads, private forums, and more!

MacMan988

macrumors 6502a
Original poster
Jul 7, 2012
760
78
Hi, how do I check which version of NetCat is installed with OS X and how do I update it if it is not a recent release?
 

MacUser2525

Suspended
Mar 17, 2007
2,097
372
Canada
Hi, how do I check which version of NetCat is installed with OS X and how do I update it if it is not a recent release?

In the Terminal.app.

Code:
MacUser2525:~$ netcat
-bash: netcat: command not found

So it is not installed though if you were to install MacPorts or most likely similar options like Fink or Homebrew you can get it.

Code:
MacUser2525:~$ locate netcat
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/net/gnetcat
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/net/gnetcat/Portfile
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/net/netcat
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/net/netcat/Portfile
 

ElectricSheep

macrumors 6502
Feb 18, 2004
498
3
Wilmington, DE
The command for netcat is nc, not netcat. It should be in /usr/bin/.

There are many clones of netcat around; you can probably find some via homebrew or macports, or build them yourself from sources.
 

MacUser2525

Suspended
Mar 17, 2007
2,097
372
Canada
The command for netcat is nc, not netcat. It should be in /usr/bin/.

There are many clones of netcat around; you can probably find some via homebrew or macports, or build them yourself from sources.

And so it is.

Code:
MacUser2525:~$ nc --version
nc: illegal option -- -
usage: nc [-46AcCDdFhklMnOortUuvz] [-K tc] [-b boundif] [-i interval] [-p source_port]
	  [-s source_ip_address] [-w timeout] [-X proxy_version]
	  [-x proxy_address[:port]] [hostname] [port[s]]

Don't want to tell you its version for some reason.
 

cerberusss

macrumors 6502a
Aug 25, 2013
928
362
The Netherlands
With Homebrew, I got version 0.7.1

Code:
$ brew install netcat
==> Downloading http://downloads.sourceforge.net/sourceforge/netcat/netcat-0.7.1.tar.bz2

This fetches the GNU version:
Code:
$ netcat --version
netcat (The GNU Netcat) 0.7.1
 

MacMan988

macrumors 6502a
Original poster
Jul 7, 2012
760
78
Thans for all replies and sorry for the delayed response as I've been having some issues with my computer. I will try the homebrew method. Btw, once its installed through home-brew, which installation comes up when you type "which nc" in terminal?
 

MacUser2525

Suspended
Mar 17, 2007
2,097
372
Canada
Thans for all replies and sorry for the delayed response as I've been having some issues with my computer. I will try the homebrew method. Btw, once its installed through home-brew, which installation comes up when you type "which nc" in terminal?

That would depend on how your path is set when using homebrew with MacPorts and rsync I get.

Code:
MacUser2525:~$ which rsync
/opt/local/bin/rsync

Whatever shows up in the path first is the program that will be used.
 

cerberusss

macrumors 6502a
Aug 25, 2013
928
362
The Netherlands
Thans for all replies and sorry for the delayed response as I've been having some issues with my computer. I will try the homebrew method. Btw, once its installed through home-brew, which installation comes up when you type "which nc" in terminal?

Code:
$ which nc
/usr/bin/nc
$ which netcat
/usr/local/bin/netcat

Apparently, brew installs the GNU version, which has "netcat", and not "nc" as the binary name:

Code:
$ netcat --version
netcat (The GNU Netcat) 0.7.1
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.