Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MacMan988

macrumors 6502a
Original poster
Jul 7, 2012
891
171
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?
 
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
 
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.
 
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.
 
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
 
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?
 
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.
 
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.