1.

Solve : Solaris IX: Redirecting output tar xf?

Answer»

Does anyone KNOW how to redirect the output of "tar xf"? I tried several plausible syntax combinations based on the manual and UNIX in a Nutshell and none of them worked, although there were several combinations that did absolutely nothing at all. What do you want to redirect? The stderr? Standard Unix pipes work in Solaris, but what exactly are you trying to do?Redirect the files.

I found something online that said that putting the -C switch in front of the output directory should work, but I tried that and it didn't.Where do you want to redirect the files?To a subdirectory below the current directory.You wouldn't do that through redirection then. Go to the directory where you want the files to appear, then issue the COMMAND: tar xf /path/to/file.tarOh, thanks.Here's an example of when you might ACTUALLY want to redirect tar output.

If I want to copy data from one filesystem to another, depending upon what whim takes my fancy, instead of using
Code: [Select]cp -pr sourcedir destdir
sometimes I use tar instead, redirecting via stdout and stdin
Code: [Select]( cd sourcedir ; tar CF - . ) | ( cd destdir ; tar xfB - )
I suppose this could be more useful I wanted to compress the data, and pipe it through ssh to another host.You may as well just use rsync for that job, which would be considerably more efficient.



Discussion

No Comment Found