Merge pull request #954 from vastpeng/cheatsheet/scp

add(cheatsheet): scp
This commit is contained in:
Rico Sta. Cruz 2018-12-25 20:32:55 +08:00 committed by GitHub
commit 996e1829a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 38 additions and 0 deletions

38
scp.md Normal file
View File

@ -0,0 +1,38 @@
---
title: scp
category: CLI
layout: 2017/sheet
updated: 2018-12-25
authors:
- github: vastpeng
---
### Usage
{: .-prime}
```bash
scp <options> source_path destination_path
```
### Conditions
```bash
-r # transfer directory
-v # see the transfer details
-C # copy files with compression
-l 800 # limit bandwith with 800
-p # preserving the original attributes of the copied files
-q # hidden the output
```
### Commands
```bash
$ scp file user@host:/path/to/file # copying a file to the remote system using scp command
$ scp user@host:/path/to/file /local/path/to/file # copying a file from the remote system using scp command
```
```bash
$ scp file1 file2 user@host:/path/to/directory # copying multiple files using scp command
$ scp -r /path/to/directory user@host:/path/to/directory # Copying an entire directory with scp command
```