No tarball other than in the streams...
$ (cd src_dir; tar cvf - .) | (cd target_dir; tar xvf -)
or never change your current directory, but wish to redirect from an existing tarball:
Update:As mem points out below, the second example above is sort of meaningless -- no need for the pipe...this is what I meant:$ (cd tarfile_dir; tar xvf - tarball.tar) | (cd tgt_dir; tar xvf -)
$ (cd tgt_dir; tar xvf - src_dir/tarball.tar)
In the cases where the tarball already exists, this presumes that the directory paths are relative vs. absolute. (as is pointed out below, you can use -C to redirect absolute paths to relative)
Matt
update: removed redundant first example, functionally nothing more than:
$ cd tgt_dir; tar xvf src_dir/tarball.tar
Because I was thinking of:
$ gunzip -c tarball.tar.gz | (cd tgtdir; tar xvf -)
In reply to Re: tar_mv: move tar data as it's being extracted
by mojotoad
in thread tar_mv: move tar data as it's being extracted
by belden
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |