OSDN Git Service

Regular updates
[twpd/master.git] / scp.md
1 ---
2 title: scp
3 category: CLI
4 layout: 2017/sheet
5 updated: 2018-12-25
6 authors:
7   - github: vastpeng
8 ---
9
10 ### Usage
11 {: .-prime}
12
13 ```bash
14 scp <options> source_path destination_path
15 ```
16
17 ### Conditions
18
19 ```bash
20 -r      # transfer directory 
21 -v      # see the transfer details
22 -C      # copy files with compression
23 -l 800  # limit bandwith with 800
24 -p      # preserving the original attributes of the copied files
25 -P      # connection port
26 -q      # hidden the output
27 ```
28
29 ### Commands
30
31 ```bash
32 $ scp file user@host:/path/to/file                        # copying a file to the remote system using scp command
33 $ scp user@host:/path/to/file /local/path/to/file         # copying a file from the remote system using scp command
34 ```
35
36 ```bash
37 $ scp file1 file2 user@host:/path/to/directory            # copying multiple files using scp command
38 $ scp -r /path/to/directory user@host:/path/to/directory  # Copying an entire directory with scp command
39 ```