The Unix tradition of “everything is a file” and using lots of small, specialized tools in a pipeline works quite well after you wrap your head around the philosophy and practice. The technique of combining utilities together in novel ways has withstood the test of time surprisingly well.
But today is different than the mid-70s –or even the mid-80s. More than ever before, we live in a networked world. And most of the tools in the standard Linux/Unix/Mac OS X toolbox are not network-aware. Sure, at a low level, a network socket acts a lot like a file descriptor for /etc/passwd, but in practice it’s not that easy.
Indeed, it’s hard to build “network pipelines” much of the time. Sometimes, you can get away with ssh and a pipe, such as ssh somehost cat /etc/foo | grep bar, but the ssh command often feels like it’s just getting in the way.
Swiss Army Plumbing
If Perl is the Swiss Army Chainsaw of scripting, then netcat and socat are the Swiss Army Plumbing of the Unix world. Both are incredibly powerful network utilities that try to make it easy to connect processes on various machines.
The Freshmeat project description for netcat says:
netcat is a simple Unix utility that reads and writes data across network connections. It’s a reliable backend tool that can be used directly or easily driven by other programs. It’s also a feature-rich network debugging and exploration tool, and has several…
Please log in to view this content.
Not Yet a Member?
Register with LinuxMagazine.com and get free access to the entire archive, including: