Copy multiple files from remote server
Copy multiple files from remote server using single command
Most of the time I need to copy multiple files from remote server. Doing it in single command can save time and some keystrokes. scp doesn’t work for this and rsync has some hard to understand syntax (well, that was just a bad joke). rsync (remote sync) can definitely be used but one can use SFTP also. I find this easy to use. Here is one of the simplest example.
$ sftp user@hostip <<EOF
get /path/to/file1 .
get /path/to/file2 .
EOF
That’s it. Hope it saves your time.
Share this post
Twitter
Google+
Facebook
Reddit
LinkedIn
StumbleUpon
Pinterest
Email