Live data from Hacker News

A Unix Utility You Should Know About: Netcat (2009)

catonmat.net

21–30 of 39 posts

Re: A Unix Utility You Should Know About: Netcat (2009)

#22
post #3

There is a better utility available for folks. Ncat - part of famous the Nmap (5) project. It has more features than netcat that people might find useful - like SCTP, SOCKS, etc.. You can find out more about it: http://nmap.org/ncat/

There's a better utility available than ncat. It's called socat. It has more features than ncat that people might find useful. http://www.dest-unreach.org/socat/doc/socat.html#EXAMPLES

Dropped into the comments to mention socat. I use it regularly to debug serial and multicast issues or to lash up network logging for random shell scripts. It's a very valuable addition to the toolbox IMO.

Edit: somehow my phone managed to post this comment three times. I've deleted the others

Re: A Unix Utility You Should Know About: Netcat (2009)

#23
post #3

There is a better utility available for folks. Ncat - part of famous the Nmap (5) project. It has more features than netcat that people might find useful - like SCTP, SOCKS, etc.. You can find out more about it: http://nmap.org/ncat/

There's a better utility available than ncat. It's called socat. It has more features than ncat that people might find useful. http://www.dest-unreach.org/socat/doc/socat.html#EXAMPLES

[deleted]

Re: A Unix Utility You Should Know About: Netcat (2009)

#24
post #3

There is a better utility available for folks. Ncat - part of famous the Nmap (5) project. It has more features than netcat that people might find useful - like SCTP, SOCKS, etc.. You can find out more about it: http://nmap.org/ncat/

There's a better utility available than ncat. It's called socat. It has more features than ncat that people might find useful. http://www.dest-unreach.org/socat/doc/socat.html#EXAMPLES

[deleted]

Re: A Unix Utility You Should Know About: Netcat (2009)

#25
post #21

All of these tools were not necessary if Networking were file based, like the /net FS in Plan9. It is the first major occasion where Unix went in a completely wrong direction. The second one was the X server.

Make a fuse filesystem for networking then...

Re: A Unix Utility You Should Know About: Netcat (2009)

#26
post #16

Be aware that GNU netcat and BSD netcat are incompatible. Many a time have I attempted to cat a file from a Mac to a PC running Linux, only to have found that Nothing Happens (tm). I just recently realized that installing BSD netcat on Linux solves the problem. Not sure what the actual incompatibility is, just a heads up.

If I remember correctly one of them requires you to specify the port with -p separately, and the other gets it from -l. So it's nc -l 1234 on one, and nc -l -p 1234 on the other.

Re: A Unix Utility You Should Know About: Netcat (2009)

#27
post #13

On a related note it's always annoyed me when people use "telnet" when they mean "make a TCP connection" as in "can you telnet to the port?"

When providing support, you have to be very precise when you ask someone to perform a check. The sentence "can you telnet to the port" is unambiguous. The sentence "can you make a TCP connection" leaves the choice of the tool unspecified. Depending of their background, some people may use ping (subject to different firewall rules), or a browser (subject to proxy configuration).

Ping doesn't make TCP connections!

Re: A Unix Utility You Should Know About: Netcat (2009)

#28
post #13

On a related note it's always annoyed me when people use "telnet" when they mean "make a TCP connection" as in "can you telnet to the port?"

When I'm testing a mail server I'll sometimes use telnet to connect (eg to port 110), or openssl for testing secured connections. What should I be using; or is it just the nomenclature you're bothered about?

Re: A Unix Utility You Should Know About: Netcat (2009)

#29
post #3

There is a better utility available for folks. Ncat - part of famous the Nmap (5) project. It has more features than netcat that people might find useful - like SCTP, SOCKS, etc.. You can find out more about it: http://nmap.org/ncat/

There's a better utility available than ncat. It's called socat. It has more features than ncat that people might find useful. http://www.dest-unreach.org/socat/doc/socat.html#EXAMPLES

I really like socat, and use it pretty regularly for interfacing with unix sockets. Ncat, and socat have a divergent featureset though. Some combination of the two yields good results.

Re: A Unix Utility You Should Know About: Netcat (2009)

#30

Earlier quoted context omitted.

When providing support, you have to be very precise when you ask someone to perform a check. The sentence "can you telnet to the port" is unambiguous. The sentence "can you make a TCP connection" leaves the choice of the tool unspecified. Depending of their background, some people may use ping (subject to different firewall rules), or a browser (subject to proxy configuration).

Ping doesn't make TCP connections!

I know, but for many people, pinging the remote host is their single idea for network issue analyse.
Post reply on HN