Today I Learned
by OneCode

SCP and multiple files

When debugging an issue, I have to check multiple log files. They are stored in the same folder…

but it takes too much time to download them manually, one after another. Fortunately, there is a solution that works in most cases.

scp command allows you to operate on many files with single command. You can find examples below.

Download leia,anakin, and obi-wan files from remote:

scp username@remote.url:/remote/dir/\{leia,anakin,obi-wan\} ./

Upload han.solo and r2.d2 files to remote:

scp han.solo r2.d2 username@remote.url:/remote/dir/path/