Home > Bash, Linux > Faster File Copy Using Tar and SSH

Faster File Copy Using Tar and SSH

How to quickly copy a file or directory over SSH using tar:

tar -cf – myfile | ssh target_host tar -xf -

If you want to change the target directory, use this:

tar -cf – myfile | ssh target_host “cd /target_dir; tar -xf -”

Categories: Bash, Linux Tags:
  1. ibharathy
    May 14th, 2009 at 02:31 | #1

    Very Useful command.. Use it.. and thanks for publishing..!

  1. No trackbacks yet.