Syntax
scp [options...] <source file> <destination>
Transfer from file from remote host to local directory
scp [email protected]:foobar.txt /some/local/directory
Transfer local file to remote host
scp foobar.txt [email protected]:/some/remote/directory
Notes:
- remote targets make use of ssh config, i.e. for a registered hostname kf,
scp kf:/foo.txt .
- source and destination can both be remote
- use
-r
to transfer a directory, i.e.scp -r foo <dest>
- transfer multiple files by listing, i.e.
scp foo.txt bar.text <dest>
- transfer multiple files from remote with expand syntax, i.e.
scp user:remote~/\{foo.txt,bar.txt\} .
Credit
—via hypexr.org