Copy multiple files from remote server

Copy multiple files from remote server using single command

Vikash Kumar

1 minute read

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.

comments powered by Disqus