Home Linux Utils
Copy all files in current directory to other directory through tar

tar cvf - . | (cd /copy/to && tar xpf -)


tar through ssh to other system

cd /copy/from
tar cvfz - . | ssh user@host '(cd /copy/to; tar xzfp -)'
tar cvfz - . | ssh user@host '(cd /copy/to; cat - > mytar.tgz)'


tar through ssh from other system

cd /copy/to
ssh user@host '(cd /copy/from; tar cfz - .)' | tar xzvfp -
ssh user@host "cat /copy/from/file.tgz" | tar xzvfp -


tar excluding files 

tar cvfX /path/mytar.tar /path/myExcludeFile .

Note: the exclude file can contain wildcards  example *.mp3 

Tar with --numeric-owner 

tar --numeric-owner -xvpzf mytar.tgz


Extract one file

tar xzvf mytar.tgz ./path/to/file


Handicaped  tar 

tar -cvf - pathToFiles | gzip -c9 > my.tar.gz
gunzip -c my.tar.gz | tar -xvpf -