Fast and Secure Remote File Transfer Using The Command Line

One of the fastest ways to transfer files between remote machines is using SSH:

tar -cz *.jpg | ssh <username@host> "tar -xzC <path-to-expand>"

This will create a single compressed archive of all jpg files in the current directory, transfer them securely to the specified host (logging in with the specified username), and then expand the archive and save the files to the specified path. Cool, isn’t it?

From my experiments this is faster than using scp, sftp and rsync. Note, though, that if you make further changes in your local directory after the initial copying to the remote machine, and you wish to sync those changes to the remote directory, then it is faster to use rsync. But the initial copying is faster using SSH.

This entry was posted in Unix Tidbits. Bookmark the permalink.

2 Responses to Fast and Secure Remote File Transfer Using The Command Line

  1. cardssharing says:

    Hey, I think your website might be having browser compatibility issues.

    When I look at your website in Safari, it looks fine but when opening in Internet Explorer, it
    has some overlapping. I just wanted to give you a quick heads up!
    Other then that, fantastic blog!

  2. Pretty! This was an extremely wonderful post.
    Thank you for providing these details.

Leave a Reply to หาแรงงานต่างด้าว Cancel reply

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