How to know which flavor of netcat I'm using?
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
There are two flavors of netcat
: netcat-openbsd and netcat-traditional.
How to know which flavor of netcat I'm using? I've tried man nc
but it doesn't say what flavor it is.
linux netcat
add a comment |Â
up vote
3
down vote
favorite
There are two flavors of netcat
: netcat-openbsd and netcat-traditional.
How to know which flavor of netcat I'm using? I've tried man nc
but it doesn't say what flavor it is.
linux netcat
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
There are two flavors of netcat
: netcat-openbsd and netcat-traditional.
How to know which flavor of netcat I'm using? I've tried man nc
but it doesn't say what flavor it is.
linux netcat
There are two flavors of netcat
: netcat-openbsd and netcat-traditional.
How to know which flavor of netcat I'm using? I've tried man nc
but it doesn't say what flavor it is.
linux netcat
asked Nov 28 '17 at 17:38
user263210
211
211
add a comment |Â
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
7
down vote
First of all, you can install multiple flavors in your machine. So the answer depends on how many flavors you've installed and what command you type.
netcat-traditional
and netcat-openbsd
is available to be install via package manager apt
in Ubuntu. In my case I also build from source to install GNU netcat
flavor via this official website.
For "openbsd" flavor, you can figure out location binary name with dpkg -L
<package-name> (Googling yourself to find equivalent of dpkg L
if yor package manager is not apt
):
$ dpkg -L netcat-openbsd | grep /bin
/bin
/bin/nc.openbsd
Then use type -a
to confirm that binary name nc.openbsd
is searchable in $PATH
and interpreted as command:
$ type -a nc.openbsd
nc.openbsd is /bin/nc.openbsd
nc.openbsd is /bin/nc.openbsd
For "traditional" flavor is same:
$ dpkg -L netcat-traditional | grep /bin
/bin
/bin/nc.traditional
$ type -a nc.traditional
nc.traditional is /bin/nc.traditional
nc.traditional is /bin/nc.traditional
That's means I can issue command nc.openbsd
to run netcat-openbsd
tool, and also command nc.traditional
to run netcat-traditional
tool. (There may confuse where the command contains '.' but package name contains '-' )
Seems like there are 3 flavors to install via apt
:
$ apt-cache search netcat --names-only
netcat-openbsd - TCP/IP swiss army knife
netcat - TCP/IP swiss army knife -- transitional package
netcat-traditional - TCP/IP swiss army knife
But actually netcat
is dummy package only:
$ apt-cache show netcat | grep Description-en -A 2
Description-en: TCP/IP swiss army knife -- transitional package
This is a "dummy" package that depends on lenny's default version of
netcat, to ease upgrades. It may be safely removed.
So you can only install netcat-openbsd
and netcat-traditional
via apt
if you want:
sudo apt-get install netcat-openbsd
sudo apt-get install netcat-traditional
How about commands nc
and netcat
? They can tied to multiple flavors searchable by $PATH
, one of the path will run if you type nc
or netcat
. Again, you can use type -a
to check, whereas priority is the first line (as bold below):
$ type -a nc
nc is /usr/local/bin/nc
nc is /bin/nc
nc is /usr/local/bin/nc
nc is /bin/nc
$ type -a netcat
netcat is /usr/local/bin/netcat
netcat is /bin/netcat
netcat is /usr/local/bin/netcat
netcat is /bin/netcat
You can use realpath
to figure out resolved path of them:
$ realpath /usr/local/bin/netcat
/usr/local/bin/netcat
$ realpath /bin/netcat
/bin/nc.openbsd
$ realpath /usr/local/bin/nc
/usr/local/bin/netcat
$ realpath /bin/nc
/bin/nc.openbsd
4 of them only 2 paths is unique in my system, one is "GNU", and the other one is "openbsd":
$ /usr/local/bin/netcat --version | head -1
netcat (The GNU Netcat) 0.7.1
$ /bin/nc.openbsd -h |& head -1
OpenBSD netcat (Debian patchlevel 1.130-3)
That's means if I type nc
OR netcat
, it will execute /usr/local/bin/netcat
which is "GNU Netcat".
You can try update-alternatives
to adjust the resolved symlink path:
$ realpath /bin/nc
/bin/nc.openbsd
$ realpath /bin/netcat
/bin/nc.openbsd
$ sudo update-alternatives --config nc
There are 2 choices for the alternative nc (providing /bin/nc).
Selection Path Priority Status
------------------------------------------------------------
0 /bin/nc.openbsd 50 auto mode
* 1 /bin/nc.openbsd 50 manual mode
2 /bin/nc.traditional 10 manual mode
Press <enter> to keep the current choice[*], or type selection number: 2
update-alternatives: using /bin/nc.traditional to provide /bin/nc (nc) in manual mode
$ realpath /bin/nc
/bin/nc.traditional
$ realpath /bin/netcat
/bin/nc.traditional
It changed both /bin/nc
and /bin/netcat
resolved symlinkù to /bin/nc.traditional
, but still it doesn't changed the flavor if I type nc
OR netcat
since /usr/local/bin/
still has higher precedence over /bin
in my $PATH
:
$ /bin/nc -h |& head -1
[v1.10-41]
$ nc -h |& head -1
GNU netcat 0.7.1, a rewrite of the famous networking tool.
$ type -a nc | head -1
nc is /usr/local/bin/nc
Note that there are more flavors of netcat, e.g. ncat, socat, sbd, netcat6, pnetcat, and cryptcat.
ù The actual symlink updated were /etc/alternatives/nc
and /etc/alternatives/netcat
, which /bin/nc
and /bin/netcat
were already symlink to /etc/alternatives/nc
and /etc/alternatives/netcat
respectively.
add a comment |Â
up vote
1
down vote
When I run nc --version
, I get:
netcat (The GNU Netcat) 0.7.1
Copyright (C) 2002 - 2003 Giovanni Giacobbi
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of this program under the terms of
the GNU General Public License.
For more information about these matters, see the file named COPYING.
Original idea and design by Avian Research <hobbit@avian.org>,
Written by Giovanni Giacobbi <giovanni@giacobbi.net>.
Maybe the BSD version will say specifically as well.
Referencing another answer, what do you get fornc -h
?
â roaima
Nov 30 '17 at 7:57
GNU netcat 0.7.1, a rewrite of the famous networking tool.
followed by the help text.
â John Moon
Nov 30 '17 at 8:54
That's interesting. It seems thatnc -h
works in "both" versions, whereasnc --version
works only for the GNU implementation. Thanks.
â roaima
Nov 30 '17 at 11:09
add a comment |Â
up vote
1
down vote
On a Mac (though it presents itself as the GNU version):
$ nc -h
GNU netcat 0.7.1, a rewrite of the famous networking tool.
[ further output snipped ]
On a Linux box (specifically Ubuntu):
$ nc -h
[v1.10-41]
[ further output snipped ]
netcat --version
, suggested in another answer, threw an 'invalid option' error to --version
, so -h
seems to potentially be a universal test.
Does GNU netcat comes pre-installed with mac OS or did you install it yourself?
â Joseph
Nov 30 '17 at 21:59
I honestly do not recall, but the fact that it's in/usr/local/bin
rather than/usr/bin
implies I may have installed it withbrew
.
â DopeGhoti
Nov 30 '17 at 22:12
One last question if you don't mind, is the binary for GNU netcat called "netcat" and "nc" is just a link for "netcat"? (because I see here that the binary is called "netcat": fedora.pkgs.org/25/rpm-sphere/â¦).
â Joseph
Nov 30 '17 at 22:18
On my system,nc
is just a symlink tonetcat
. You can check yourself withfile $(which nc)
which gives me/usr/bin/nc: symbolic link to netcat
.
â John Moon
Dec 1 '17 at 0:56
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
7
down vote
First of all, you can install multiple flavors in your machine. So the answer depends on how many flavors you've installed and what command you type.
netcat-traditional
and netcat-openbsd
is available to be install via package manager apt
in Ubuntu. In my case I also build from source to install GNU netcat
flavor via this official website.
For "openbsd" flavor, you can figure out location binary name with dpkg -L
<package-name> (Googling yourself to find equivalent of dpkg L
if yor package manager is not apt
):
$ dpkg -L netcat-openbsd | grep /bin
/bin
/bin/nc.openbsd
Then use type -a
to confirm that binary name nc.openbsd
is searchable in $PATH
and interpreted as command:
$ type -a nc.openbsd
nc.openbsd is /bin/nc.openbsd
nc.openbsd is /bin/nc.openbsd
For "traditional" flavor is same:
$ dpkg -L netcat-traditional | grep /bin
/bin
/bin/nc.traditional
$ type -a nc.traditional
nc.traditional is /bin/nc.traditional
nc.traditional is /bin/nc.traditional
That's means I can issue command nc.openbsd
to run netcat-openbsd
tool, and also command nc.traditional
to run netcat-traditional
tool. (There may confuse where the command contains '.' but package name contains '-' )
Seems like there are 3 flavors to install via apt
:
$ apt-cache search netcat --names-only
netcat-openbsd - TCP/IP swiss army knife
netcat - TCP/IP swiss army knife -- transitional package
netcat-traditional - TCP/IP swiss army knife
But actually netcat
is dummy package only:
$ apt-cache show netcat | grep Description-en -A 2
Description-en: TCP/IP swiss army knife -- transitional package
This is a "dummy" package that depends on lenny's default version of
netcat, to ease upgrades. It may be safely removed.
So you can only install netcat-openbsd
and netcat-traditional
via apt
if you want:
sudo apt-get install netcat-openbsd
sudo apt-get install netcat-traditional
How about commands nc
and netcat
? They can tied to multiple flavors searchable by $PATH
, one of the path will run if you type nc
or netcat
. Again, you can use type -a
to check, whereas priority is the first line (as bold below):
$ type -a nc
nc is /usr/local/bin/nc
nc is /bin/nc
nc is /usr/local/bin/nc
nc is /bin/nc
$ type -a netcat
netcat is /usr/local/bin/netcat
netcat is /bin/netcat
netcat is /usr/local/bin/netcat
netcat is /bin/netcat
You can use realpath
to figure out resolved path of them:
$ realpath /usr/local/bin/netcat
/usr/local/bin/netcat
$ realpath /bin/netcat
/bin/nc.openbsd
$ realpath /usr/local/bin/nc
/usr/local/bin/netcat
$ realpath /bin/nc
/bin/nc.openbsd
4 of them only 2 paths is unique in my system, one is "GNU", and the other one is "openbsd":
$ /usr/local/bin/netcat --version | head -1
netcat (The GNU Netcat) 0.7.1
$ /bin/nc.openbsd -h |& head -1
OpenBSD netcat (Debian patchlevel 1.130-3)
That's means if I type nc
OR netcat
, it will execute /usr/local/bin/netcat
which is "GNU Netcat".
You can try update-alternatives
to adjust the resolved symlink path:
$ realpath /bin/nc
/bin/nc.openbsd
$ realpath /bin/netcat
/bin/nc.openbsd
$ sudo update-alternatives --config nc
There are 2 choices for the alternative nc (providing /bin/nc).
Selection Path Priority Status
------------------------------------------------------------
0 /bin/nc.openbsd 50 auto mode
* 1 /bin/nc.openbsd 50 manual mode
2 /bin/nc.traditional 10 manual mode
Press <enter> to keep the current choice[*], or type selection number: 2
update-alternatives: using /bin/nc.traditional to provide /bin/nc (nc) in manual mode
$ realpath /bin/nc
/bin/nc.traditional
$ realpath /bin/netcat
/bin/nc.traditional
It changed both /bin/nc
and /bin/netcat
resolved symlinkù to /bin/nc.traditional
, but still it doesn't changed the flavor if I type nc
OR netcat
since /usr/local/bin/
still has higher precedence over /bin
in my $PATH
:
$ /bin/nc -h |& head -1
[v1.10-41]
$ nc -h |& head -1
GNU netcat 0.7.1, a rewrite of the famous networking tool.
$ type -a nc | head -1
nc is /usr/local/bin/nc
Note that there are more flavors of netcat, e.g. ncat, socat, sbd, netcat6, pnetcat, and cryptcat.
ù The actual symlink updated were /etc/alternatives/nc
and /etc/alternatives/netcat
, which /bin/nc
and /bin/netcat
were already symlink to /etc/alternatives/nc
and /etc/alternatives/netcat
respectively.
add a comment |Â
up vote
7
down vote
First of all, you can install multiple flavors in your machine. So the answer depends on how many flavors you've installed and what command you type.
netcat-traditional
and netcat-openbsd
is available to be install via package manager apt
in Ubuntu. In my case I also build from source to install GNU netcat
flavor via this official website.
For "openbsd" flavor, you can figure out location binary name with dpkg -L
<package-name> (Googling yourself to find equivalent of dpkg L
if yor package manager is not apt
):
$ dpkg -L netcat-openbsd | grep /bin
/bin
/bin/nc.openbsd
Then use type -a
to confirm that binary name nc.openbsd
is searchable in $PATH
and interpreted as command:
$ type -a nc.openbsd
nc.openbsd is /bin/nc.openbsd
nc.openbsd is /bin/nc.openbsd
For "traditional" flavor is same:
$ dpkg -L netcat-traditional | grep /bin
/bin
/bin/nc.traditional
$ type -a nc.traditional
nc.traditional is /bin/nc.traditional
nc.traditional is /bin/nc.traditional
That's means I can issue command nc.openbsd
to run netcat-openbsd
tool, and also command nc.traditional
to run netcat-traditional
tool. (There may confuse where the command contains '.' but package name contains '-' )
Seems like there are 3 flavors to install via apt
:
$ apt-cache search netcat --names-only
netcat-openbsd - TCP/IP swiss army knife
netcat - TCP/IP swiss army knife -- transitional package
netcat-traditional - TCP/IP swiss army knife
But actually netcat
is dummy package only:
$ apt-cache show netcat | grep Description-en -A 2
Description-en: TCP/IP swiss army knife -- transitional package
This is a "dummy" package that depends on lenny's default version of
netcat, to ease upgrades. It may be safely removed.
So you can only install netcat-openbsd
and netcat-traditional
via apt
if you want:
sudo apt-get install netcat-openbsd
sudo apt-get install netcat-traditional
How about commands nc
and netcat
? They can tied to multiple flavors searchable by $PATH
, one of the path will run if you type nc
or netcat
. Again, you can use type -a
to check, whereas priority is the first line (as bold below):
$ type -a nc
nc is /usr/local/bin/nc
nc is /bin/nc
nc is /usr/local/bin/nc
nc is /bin/nc
$ type -a netcat
netcat is /usr/local/bin/netcat
netcat is /bin/netcat
netcat is /usr/local/bin/netcat
netcat is /bin/netcat
You can use realpath
to figure out resolved path of them:
$ realpath /usr/local/bin/netcat
/usr/local/bin/netcat
$ realpath /bin/netcat
/bin/nc.openbsd
$ realpath /usr/local/bin/nc
/usr/local/bin/netcat
$ realpath /bin/nc
/bin/nc.openbsd
4 of them only 2 paths is unique in my system, one is "GNU", and the other one is "openbsd":
$ /usr/local/bin/netcat --version | head -1
netcat (The GNU Netcat) 0.7.1
$ /bin/nc.openbsd -h |& head -1
OpenBSD netcat (Debian patchlevel 1.130-3)
That's means if I type nc
OR netcat
, it will execute /usr/local/bin/netcat
which is "GNU Netcat".
You can try update-alternatives
to adjust the resolved symlink path:
$ realpath /bin/nc
/bin/nc.openbsd
$ realpath /bin/netcat
/bin/nc.openbsd
$ sudo update-alternatives --config nc
There are 2 choices for the alternative nc (providing /bin/nc).
Selection Path Priority Status
------------------------------------------------------------
0 /bin/nc.openbsd 50 auto mode
* 1 /bin/nc.openbsd 50 manual mode
2 /bin/nc.traditional 10 manual mode
Press <enter> to keep the current choice[*], or type selection number: 2
update-alternatives: using /bin/nc.traditional to provide /bin/nc (nc) in manual mode
$ realpath /bin/nc
/bin/nc.traditional
$ realpath /bin/netcat
/bin/nc.traditional
It changed both /bin/nc
and /bin/netcat
resolved symlinkù to /bin/nc.traditional
, but still it doesn't changed the flavor if I type nc
OR netcat
since /usr/local/bin/
still has higher precedence over /bin
in my $PATH
:
$ /bin/nc -h |& head -1
[v1.10-41]
$ nc -h |& head -1
GNU netcat 0.7.1, a rewrite of the famous networking tool.
$ type -a nc | head -1
nc is /usr/local/bin/nc
Note that there are more flavors of netcat, e.g. ncat, socat, sbd, netcat6, pnetcat, and cryptcat.
ù The actual symlink updated were /etc/alternatives/nc
and /etc/alternatives/netcat
, which /bin/nc
and /bin/netcat
were already symlink to /etc/alternatives/nc
and /etc/alternatives/netcat
respectively.
add a comment |Â
up vote
7
down vote
up vote
7
down vote
First of all, you can install multiple flavors in your machine. So the answer depends on how many flavors you've installed and what command you type.
netcat-traditional
and netcat-openbsd
is available to be install via package manager apt
in Ubuntu. In my case I also build from source to install GNU netcat
flavor via this official website.
For "openbsd" flavor, you can figure out location binary name with dpkg -L
<package-name> (Googling yourself to find equivalent of dpkg L
if yor package manager is not apt
):
$ dpkg -L netcat-openbsd | grep /bin
/bin
/bin/nc.openbsd
Then use type -a
to confirm that binary name nc.openbsd
is searchable in $PATH
and interpreted as command:
$ type -a nc.openbsd
nc.openbsd is /bin/nc.openbsd
nc.openbsd is /bin/nc.openbsd
For "traditional" flavor is same:
$ dpkg -L netcat-traditional | grep /bin
/bin
/bin/nc.traditional
$ type -a nc.traditional
nc.traditional is /bin/nc.traditional
nc.traditional is /bin/nc.traditional
That's means I can issue command nc.openbsd
to run netcat-openbsd
tool, and also command nc.traditional
to run netcat-traditional
tool. (There may confuse where the command contains '.' but package name contains '-' )
Seems like there are 3 flavors to install via apt
:
$ apt-cache search netcat --names-only
netcat-openbsd - TCP/IP swiss army knife
netcat - TCP/IP swiss army knife -- transitional package
netcat-traditional - TCP/IP swiss army knife
But actually netcat
is dummy package only:
$ apt-cache show netcat | grep Description-en -A 2
Description-en: TCP/IP swiss army knife -- transitional package
This is a "dummy" package that depends on lenny's default version of
netcat, to ease upgrades. It may be safely removed.
So you can only install netcat-openbsd
and netcat-traditional
via apt
if you want:
sudo apt-get install netcat-openbsd
sudo apt-get install netcat-traditional
How about commands nc
and netcat
? They can tied to multiple flavors searchable by $PATH
, one of the path will run if you type nc
or netcat
. Again, you can use type -a
to check, whereas priority is the first line (as bold below):
$ type -a nc
nc is /usr/local/bin/nc
nc is /bin/nc
nc is /usr/local/bin/nc
nc is /bin/nc
$ type -a netcat
netcat is /usr/local/bin/netcat
netcat is /bin/netcat
netcat is /usr/local/bin/netcat
netcat is /bin/netcat
You can use realpath
to figure out resolved path of them:
$ realpath /usr/local/bin/netcat
/usr/local/bin/netcat
$ realpath /bin/netcat
/bin/nc.openbsd
$ realpath /usr/local/bin/nc
/usr/local/bin/netcat
$ realpath /bin/nc
/bin/nc.openbsd
4 of them only 2 paths is unique in my system, one is "GNU", and the other one is "openbsd":
$ /usr/local/bin/netcat --version | head -1
netcat (The GNU Netcat) 0.7.1
$ /bin/nc.openbsd -h |& head -1
OpenBSD netcat (Debian patchlevel 1.130-3)
That's means if I type nc
OR netcat
, it will execute /usr/local/bin/netcat
which is "GNU Netcat".
You can try update-alternatives
to adjust the resolved symlink path:
$ realpath /bin/nc
/bin/nc.openbsd
$ realpath /bin/netcat
/bin/nc.openbsd
$ sudo update-alternatives --config nc
There are 2 choices for the alternative nc (providing /bin/nc).
Selection Path Priority Status
------------------------------------------------------------
0 /bin/nc.openbsd 50 auto mode
* 1 /bin/nc.openbsd 50 manual mode
2 /bin/nc.traditional 10 manual mode
Press <enter> to keep the current choice[*], or type selection number: 2
update-alternatives: using /bin/nc.traditional to provide /bin/nc (nc) in manual mode
$ realpath /bin/nc
/bin/nc.traditional
$ realpath /bin/netcat
/bin/nc.traditional
It changed both /bin/nc
and /bin/netcat
resolved symlinkù to /bin/nc.traditional
, but still it doesn't changed the flavor if I type nc
OR netcat
since /usr/local/bin/
still has higher precedence over /bin
in my $PATH
:
$ /bin/nc -h |& head -1
[v1.10-41]
$ nc -h |& head -1
GNU netcat 0.7.1, a rewrite of the famous networking tool.
$ type -a nc | head -1
nc is /usr/local/bin/nc
Note that there are more flavors of netcat, e.g. ncat, socat, sbd, netcat6, pnetcat, and cryptcat.
ù The actual symlink updated were /etc/alternatives/nc
and /etc/alternatives/netcat
, which /bin/nc
and /bin/netcat
were already symlink to /etc/alternatives/nc
and /etc/alternatives/netcat
respectively.
First of all, you can install multiple flavors in your machine. So the answer depends on how many flavors you've installed and what command you type.
netcat-traditional
and netcat-openbsd
is available to be install via package manager apt
in Ubuntu. In my case I also build from source to install GNU netcat
flavor via this official website.
For "openbsd" flavor, you can figure out location binary name with dpkg -L
<package-name> (Googling yourself to find equivalent of dpkg L
if yor package manager is not apt
):
$ dpkg -L netcat-openbsd | grep /bin
/bin
/bin/nc.openbsd
Then use type -a
to confirm that binary name nc.openbsd
is searchable in $PATH
and interpreted as command:
$ type -a nc.openbsd
nc.openbsd is /bin/nc.openbsd
nc.openbsd is /bin/nc.openbsd
For "traditional" flavor is same:
$ dpkg -L netcat-traditional | grep /bin
/bin
/bin/nc.traditional
$ type -a nc.traditional
nc.traditional is /bin/nc.traditional
nc.traditional is /bin/nc.traditional
That's means I can issue command nc.openbsd
to run netcat-openbsd
tool, and also command nc.traditional
to run netcat-traditional
tool. (There may confuse where the command contains '.' but package name contains '-' )
Seems like there are 3 flavors to install via apt
:
$ apt-cache search netcat --names-only
netcat-openbsd - TCP/IP swiss army knife
netcat - TCP/IP swiss army knife -- transitional package
netcat-traditional - TCP/IP swiss army knife
But actually netcat
is dummy package only:
$ apt-cache show netcat | grep Description-en -A 2
Description-en: TCP/IP swiss army knife -- transitional package
This is a "dummy" package that depends on lenny's default version of
netcat, to ease upgrades. It may be safely removed.
So you can only install netcat-openbsd
and netcat-traditional
via apt
if you want:
sudo apt-get install netcat-openbsd
sudo apt-get install netcat-traditional
How about commands nc
and netcat
? They can tied to multiple flavors searchable by $PATH
, one of the path will run if you type nc
or netcat
. Again, you can use type -a
to check, whereas priority is the first line (as bold below):
$ type -a nc
nc is /usr/local/bin/nc
nc is /bin/nc
nc is /usr/local/bin/nc
nc is /bin/nc
$ type -a netcat
netcat is /usr/local/bin/netcat
netcat is /bin/netcat
netcat is /usr/local/bin/netcat
netcat is /bin/netcat
You can use realpath
to figure out resolved path of them:
$ realpath /usr/local/bin/netcat
/usr/local/bin/netcat
$ realpath /bin/netcat
/bin/nc.openbsd
$ realpath /usr/local/bin/nc
/usr/local/bin/netcat
$ realpath /bin/nc
/bin/nc.openbsd
4 of them only 2 paths is unique in my system, one is "GNU", and the other one is "openbsd":
$ /usr/local/bin/netcat --version | head -1
netcat (The GNU Netcat) 0.7.1
$ /bin/nc.openbsd -h |& head -1
OpenBSD netcat (Debian patchlevel 1.130-3)
That's means if I type nc
OR netcat
, it will execute /usr/local/bin/netcat
which is "GNU Netcat".
You can try update-alternatives
to adjust the resolved symlink path:
$ realpath /bin/nc
/bin/nc.openbsd
$ realpath /bin/netcat
/bin/nc.openbsd
$ sudo update-alternatives --config nc
There are 2 choices for the alternative nc (providing /bin/nc).
Selection Path Priority Status
------------------------------------------------------------
0 /bin/nc.openbsd 50 auto mode
* 1 /bin/nc.openbsd 50 manual mode
2 /bin/nc.traditional 10 manual mode
Press <enter> to keep the current choice[*], or type selection number: 2
update-alternatives: using /bin/nc.traditional to provide /bin/nc (nc) in manual mode
$ realpath /bin/nc
/bin/nc.traditional
$ realpath /bin/netcat
/bin/nc.traditional
It changed both /bin/nc
and /bin/netcat
resolved symlinkù to /bin/nc.traditional
, but still it doesn't changed the flavor if I type nc
OR netcat
since /usr/local/bin/
still has higher precedence over /bin
in my $PATH
:
$ /bin/nc -h |& head -1
[v1.10-41]
$ nc -h |& head -1
GNU netcat 0.7.1, a rewrite of the famous networking tool.
$ type -a nc | head -1
nc is /usr/local/bin/nc
Note that there are more flavors of netcat, e.g. ncat, socat, sbd, netcat6, pnetcat, and cryptcat.
ù The actual symlink updated were /etc/alternatives/nc
and /etc/alternatives/netcat
, which /bin/nc
and /bin/netcat
were already symlink to /etc/alternatives/nc
and /etc/alternatives/netcat
respectively.
edited Dec 2 '17 at 16:19
answered Nov 28 '17 at 20:13
æÂÂæÂÂçÂÂ
2,2131228
2,2131228
add a comment |Â
add a comment |Â
up vote
1
down vote
When I run nc --version
, I get:
netcat (The GNU Netcat) 0.7.1
Copyright (C) 2002 - 2003 Giovanni Giacobbi
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of this program under the terms of
the GNU General Public License.
For more information about these matters, see the file named COPYING.
Original idea and design by Avian Research <hobbit@avian.org>,
Written by Giovanni Giacobbi <giovanni@giacobbi.net>.
Maybe the BSD version will say specifically as well.
Referencing another answer, what do you get fornc -h
?
â roaima
Nov 30 '17 at 7:57
GNU netcat 0.7.1, a rewrite of the famous networking tool.
followed by the help text.
â John Moon
Nov 30 '17 at 8:54
That's interesting. It seems thatnc -h
works in "both" versions, whereasnc --version
works only for the GNU implementation. Thanks.
â roaima
Nov 30 '17 at 11:09
add a comment |Â
up vote
1
down vote
When I run nc --version
, I get:
netcat (The GNU Netcat) 0.7.1
Copyright (C) 2002 - 2003 Giovanni Giacobbi
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of this program under the terms of
the GNU General Public License.
For more information about these matters, see the file named COPYING.
Original idea and design by Avian Research <hobbit@avian.org>,
Written by Giovanni Giacobbi <giovanni@giacobbi.net>.
Maybe the BSD version will say specifically as well.
Referencing another answer, what do you get fornc -h
?
â roaima
Nov 30 '17 at 7:57
GNU netcat 0.7.1, a rewrite of the famous networking tool.
followed by the help text.
â John Moon
Nov 30 '17 at 8:54
That's interesting. It seems thatnc -h
works in "both" versions, whereasnc --version
works only for the GNU implementation. Thanks.
â roaima
Nov 30 '17 at 11:09
add a comment |Â
up vote
1
down vote
up vote
1
down vote
When I run nc --version
, I get:
netcat (The GNU Netcat) 0.7.1
Copyright (C) 2002 - 2003 Giovanni Giacobbi
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of this program under the terms of
the GNU General Public License.
For more information about these matters, see the file named COPYING.
Original idea and design by Avian Research <hobbit@avian.org>,
Written by Giovanni Giacobbi <giovanni@giacobbi.net>.
Maybe the BSD version will say specifically as well.
When I run nc --version
, I get:
netcat (The GNU Netcat) 0.7.1
Copyright (C) 2002 - 2003 Giovanni Giacobbi
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of this program under the terms of
the GNU General Public License.
For more information about these matters, see the file named COPYING.
Original idea and design by Avian Research <hobbit@avian.org>,
Written by Giovanni Giacobbi <giovanni@giacobbi.net>.
Maybe the BSD version will say specifically as well.
answered Nov 28 '17 at 17:42
John Moon
49026
49026
Referencing another answer, what do you get fornc -h
?
â roaima
Nov 30 '17 at 7:57
GNU netcat 0.7.1, a rewrite of the famous networking tool.
followed by the help text.
â John Moon
Nov 30 '17 at 8:54
That's interesting. It seems thatnc -h
works in "both" versions, whereasnc --version
works only for the GNU implementation. Thanks.
â roaima
Nov 30 '17 at 11:09
add a comment |Â
Referencing another answer, what do you get fornc -h
?
â roaima
Nov 30 '17 at 7:57
GNU netcat 0.7.1, a rewrite of the famous networking tool.
followed by the help text.
â John Moon
Nov 30 '17 at 8:54
That's interesting. It seems thatnc -h
works in "both" versions, whereasnc --version
works only for the GNU implementation. Thanks.
â roaima
Nov 30 '17 at 11:09
Referencing another answer, what do you get for
nc -h
?â roaima
Nov 30 '17 at 7:57
Referencing another answer, what do you get for
nc -h
?â roaima
Nov 30 '17 at 7:57
GNU netcat 0.7.1, a rewrite of the famous networking tool.
followed by the help text.â John Moon
Nov 30 '17 at 8:54
GNU netcat 0.7.1, a rewrite of the famous networking tool.
followed by the help text.â John Moon
Nov 30 '17 at 8:54
That's interesting. It seems that
nc -h
works in "both" versions, whereas nc --version
works only for the GNU implementation. Thanks.â roaima
Nov 30 '17 at 11:09
That's interesting. It seems that
nc -h
works in "both" versions, whereas nc --version
works only for the GNU implementation. Thanks.â roaima
Nov 30 '17 at 11:09
add a comment |Â
up vote
1
down vote
On a Mac (though it presents itself as the GNU version):
$ nc -h
GNU netcat 0.7.1, a rewrite of the famous networking tool.
[ further output snipped ]
On a Linux box (specifically Ubuntu):
$ nc -h
[v1.10-41]
[ further output snipped ]
netcat --version
, suggested in another answer, threw an 'invalid option' error to --version
, so -h
seems to potentially be a universal test.
Does GNU netcat comes pre-installed with mac OS or did you install it yourself?
â Joseph
Nov 30 '17 at 21:59
I honestly do not recall, but the fact that it's in/usr/local/bin
rather than/usr/bin
implies I may have installed it withbrew
.
â DopeGhoti
Nov 30 '17 at 22:12
One last question if you don't mind, is the binary for GNU netcat called "netcat" and "nc" is just a link for "netcat"? (because I see here that the binary is called "netcat": fedora.pkgs.org/25/rpm-sphere/â¦).
â Joseph
Nov 30 '17 at 22:18
On my system,nc
is just a symlink tonetcat
. You can check yourself withfile $(which nc)
which gives me/usr/bin/nc: symbolic link to netcat
.
â John Moon
Dec 1 '17 at 0:56
add a comment |Â
up vote
1
down vote
On a Mac (though it presents itself as the GNU version):
$ nc -h
GNU netcat 0.7.1, a rewrite of the famous networking tool.
[ further output snipped ]
On a Linux box (specifically Ubuntu):
$ nc -h
[v1.10-41]
[ further output snipped ]
netcat --version
, suggested in another answer, threw an 'invalid option' error to --version
, so -h
seems to potentially be a universal test.
Does GNU netcat comes pre-installed with mac OS or did you install it yourself?
â Joseph
Nov 30 '17 at 21:59
I honestly do not recall, but the fact that it's in/usr/local/bin
rather than/usr/bin
implies I may have installed it withbrew
.
â DopeGhoti
Nov 30 '17 at 22:12
One last question if you don't mind, is the binary for GNU netcat called "netcat" and "nc" is just a link for "netcat"? (because I see here that the binary is called "netcat": fedora.pkgs.org/25/rpm-sphere/â¦).
â Joseph
Nov 30 '17 at 22:18
On my system,nc
is just a symlink tonetcat
. You can check yourself withfile $(which nc)
which gives me/usr/bin/nc: symbolic link to netcat
.
â John Moon
Dec 1 '17 at 0:56
add a comment |Â
up vote
1
down vote
up vote
1
down vote
On a Mac (though it presents itself as the GNU version):
$ nc -h
GNU netcat 0.7.1, a rewrite of the famous networking tool.
[ further output snipped ]
On a Linux box (specifically Ubuntu):
$ nc -h
[v1.10-41]
[ further output snipped ]
netcat --version
, suggested in another answer, threw an 'invalid option' error to --version
, so -h
seems to potentially be a universal test.
On a Mac (though it presents itself as the GNU version):
$ nc -h
GNU netcat 0.7.1, a rewrite of the famous networking tool.
[ further output snipped ]
On a Linux box (specifically Ubuntu):
$ nc -h
[v1.10-41]
[ further output snipped ]
netcat --version
, suggested in another answer, threw an 'invalid option' error to --version
, so -h
seems to potentially be a universal test.
answered Nov 28 '17 at 17:58
DopeGhoti
40.6k54979
40.6k54979
Does GNU netcat comes pre-installed with mac OS or did you install it yourself?
â Joseph
Nov 30 '17 at 21:59
I honestly do not recall, but the fact that it's in/usr/local/bin
rather than/usr/bin
implies I may have installed it withbrew
.
â DopeGhoti
Nov 30 '17 at 22:12
One last question if you don't mind, is the binary for GNU netcat called "netcat" and "nc" is just a link for "netcat"? (because I see here that the binary is called "netcat": fedora.pkgs.org/25/rpm-sphere/â¦).
â Joseph
Nov 30 '17 at 22:18
On my system,nc
is just a symlink tonetcat
. You can check yourself withfile $(which nc)
which gives me/usr/bin/nc: symbolic link to netcat
.
â John Moon
Dec 1 '17 at 0:56
add a comment |Â
Does GNU netcat comes pre-installed with mac OS or did you install it yourself?
â Joseph
Nov 30 '17 at 21:59
I honestly do not recall, but the fact that it's in/usr/local/bin
rather than/usr/bin
implies I may have installed it withbrew
.
â DopeGhoti
Nov 30 '17 at 22:12
One last question if you don't mind, is the binary for GNU netcat called "netcat" and "nc" is just a link for "netcat"? (because I see here that the binary is called "netcat": fedora.pkgs.org/25/rpm-sphere/â¦).
â Joseph
Nov 30 '17 at 22:18
On my system,nc
is just a symlink tonetcat
. You can check yourself withfile $(which nc)
which gives me/usr/bin/nc: symbolic link to netcat
.
â John Moon
Dec 1 '17 at 0:56
Does GNU netcat comes pre-installed with mac OS or did you install it yourself?
â Joseph
Nov 30 '17 at 21:59
Does GNU netcat comes pre-installed with mac OS or did you install it yourself?
â Joseph
Nov 30 '17 at 21:59
I honestly do not recall, but the fact that it's in
/usr/local/bin
rather than /usr/bin
implies I may have installed it with brew
.â DopeGhoti
Nov 30 '17 at 22:12
I honestly do not recall, but the fact that it's in
/usr/local/bin
rather than /usr/bin
implies I may have installed it with brew
.â DopeGhoti
Nov 30 '17 at 22:12
One last question if you don't mind, is the binary for GNU netcat called "netcat" and "nc" is just a link for "netcat"? (because I see here that the binary is called "netcat": fedora.pkgs.org/25/rpm-sphere/â¦).
â Joseph
Nov 30 '17 at 22:18
One last question if you don't mind, is the binary for GNU netcat called "netcat" and "nc" is just a link for "netcat"? (because I see here that the binary is called "netcat": fedora.pkgs.org/25/rpm-sphere/â¦).
â Joseph
Nov 30 '17 at 22:18
On my system,
nc
is just a symlink to netcat
. You can check yourself with file $(which nc)
which gives me /usr/bin/nc: symbolic link to netcat
.â John Moon
Dec 1 '17 at 0:56
On my system,
nc
is just a symlink to netcat
. You can check yourself with file $(which nc)
which gives me /usr/bin/nc: symbolic link to netcat
.â John Moon
Dec 1 '17 at 0:56
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f407547%2fhow-to-know-which-flavor-of-netcat-im-using%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password