News for hackers. Stuff that matters.
Re:A Unix Utility You Should Know About: Pipe Viewer by alnayyir on Wednesday February 04, 2009 @12:54AM (#465309)
you know, it's cool that you do that (quite neat in fact), but why is this better than scp'ing something, pray tell?
Re:A Unix Utility You Should Know About: Pipe Viewer by meredydd on Wednesday February 04, 2009 @05:40AM (#465563)
My favourite two reasons for using it:

1. I often tend to use it when I want to pipe the output into a command. If it's a big transfer, I don't really want to have to stream several gigabytes of data onto disk, then off it, then back on again. Restoring a database dump is one example:

  me@host1$ nc -l -p <port> < db_dump.sql

  postgres@host2$ nc <host> <port> | psql db-name

2. The other big advantage over scp is that sometimes, your target (deliberately) isn't accessible directly from an SSH login.

In the example above, I want to process that data as the 'postgres' user, but there's no way I'm allowing direct logins as that user. 'root' is, of course, the other common example.

Re:A Unix Utility You Should Know About: Pipe Viewer by yan on Wednesday February 04, 2009 @08:49AM (#465711)
Firstly, if the two machines are on the same switch this method is noticeably faster than scp'ing something large. The actual main reason though, is that this isn't limited to tarring over a network. What it comes down to, is you can almost seamlessly have a shell pipeline and one of those stages jumps a machine boundary.
Re:A Unix Utility You Should Know About: Pipe Viewer by alnayyir on Wednesday February 04, 2009 @02:50PM (#466356)
I see. Gotta love netcat.