2013-12-08 08:56:16 +00:00
|
|
|
# scp
|
|
|
|
|
2013-12-09 11:12:16 +00:00
|
|
|
> Copies files between hosts on a network
|
|
|
|
> Works over a secure connection (SSH)
|
2013-12-08 08:56:16 +00:00
|
|
|
|
2014-01-30 14:22:27 +00:00
|
|
|
- upload a file
|
|
|
|
|
|
|
|
`scp {{/local/file.txt}} {{10.0.0.1}}:{{/remote/path/}}`
|
|
|
|
|
|
|
|
- upload a file and change its name
|
|
|
|
|
|
|
|
`scp {{/local/file.txt}} {{10.0.0.1}}:{{/remote/path/newname.txt}}`
|
|
|
|
|
|
|
|
- upload a folder
|
2013-12-08 08:56:16 +00:00
|
|
|
|
2013-12-09 11:12:16 +00:00
|
|
|
`scp -r {{/local/folder}} {{10.0.0.1}}:{{/remote/path/}}`
|
2013-12-08 08:56:16 +00:00
|
|
|
|
2014-01-30 14:22:27 +00:00
|
|
|
- download a file
|
2013-12-08 08:56:16 +00:00
|
|
|
|
2014-01-30 14:22:27 +00:00
|
|
|
`scp {{10.0.0.1}}:{{/remote/path/file.txt}} {{/local/folder}}`
|
|
|
|
|
|
|
|
- download a folder
|
|
|
|
|
|
|
|
`scp -r {{10.0.0.1}}:{{/remote/path}} {{/local/folder}}`
|
2013-12-08 08:56:16 +00:00
|
|
|
|
2013-12-09 11:12:16 +00:00
|
|
|
- specify credentials
|
2013-12-08 08:56:16 +00:00
|
|
|
|
2014-01-30 14:22:27 +00:00
|
|
|
`scp {{/local/file.txt}} {{my_user}}@{{10.0.0.1}}:{{/remote/path}}`
|
|
|
|
|
|
|
|
- copy a file from one host to another
|
|
|
|
|
|
|
|
`scp {{10.0.0.1}}:{{/remote/path/file.txt}} {{20.0.0.2}}:{{/other/remote/path}}`
|