1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-06-06 23:46:00 +02:00

Merge pull request #54 from jegtnes/patch-1

Improving scp page
This commit is contained in:
Romain Prieto 2014-01-30 14:17:34 -08:00
commit b5b6072a06

View file

@ -3,16 +3,24 @@
> Copies files between hosts on a network > Copies files between hosts on a network
> Works over a secure connection (SSH) > Works over a secure connection (SSH)
- upload a file or directory - upload a file, or upload and rename a file
`scp {{/local/file.txt}} {{10.0.0.1}}:{{/remote/path/}}`
`scp {{/local/file.txt}} {{10.0.0.1}}:{{/remote/path/newname.txt}}`
- download a file
`scp {{10.0.0.1}}:{{/remote/path/file.txt}} {{/local/folder}}`
- upload or download a directory
`scp {{/local/file}} {{10.0.0.1}}:{{/remote/path/}}`
`scp {{/local/file}} {{10.0.0.1}}:{{/remote/path/newname}}`
`scp -r {{/local/folder}} {{10.0.0.1}}:{{/remote/path/}}` `scp -r {{/local/folder}} {{10.0.0.1}}:{{/remote/path/}}`
`scp -r {{10.0.0.1}}:{{/remote/path}} {{/local/folder}}`
- download a file (reversed) - specify username on host
`scp {{10.0.0.1}}:{{/remote/path/filename}} {{/local/file}}` `scp {{/local/file.txt}} {{my_user}}@{{10.0.0.1}}:{{/remote/path}}`
- specify credentials - copy a file from one host to another
`scp {{/local/file}} {{my_user}}@{{10.0.0.1}}:{{/remote/path/}}` `scp {{10.0.0.1}}:{{/remote/path/file.txt}} {{20.0.0.2}}:{{/other/remote/path}}`