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 -”

This entry was posted in Bash, Linux. Bookmark the permalink.

One Response to Faster File Copy Using Tar and SSH

  1. ibharathy says:

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

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>