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 -q      # hidden the output
26 ```
27
28 ### Commands
29
30 ```bash
31 $ scp file user@host:/path/to/file                        # copying a file to the remote system using scp command
32 $ scp user@host:/path/to/file /local/path/to/file         # copying a file from the remote system using scp command
33 ```
34
35 ```bash
36 $ scp file1 file2 user@host:/path/to/directory            # copying multiple files using scp command
37 $ scp -r /path/to/directory user@host:/path/to/directory  # Copying an entire directory with scp command
38 ```