2018-12-06 01:59:38 +00:00
|
|
|
---
|
|
|
|
title: scp
|
|
|
|
category: CLI
|
2018-12-25 12:28:54 +00:00
|
|
|
updated: 2018-12-25
|
2018-12-25 12:27:52 +00:00
|
|
|
authors:
|
|
|
|
- github: vastpeng
|
2018-12-06 01:59:38 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
### Usage
|
|
|
|
{: .-prime}
|
|
|
|
|
|
|
|
```bash
|
|
|
|
scp <options> source_path destination_path
|
|
|
|
```
|
|
|
|
|
|
|
|
### Conditions
|
|
|
|
|
|
|
|
```bash
|
|
|
|
-r # transfer directory
|
|
|
|
-v # see the transfer details
|
|
|
|
-C # copy files with compression
|
2024-03-21 21:53:26 +00:00
|
|
|
-l 800 # limit bandwidth with 800
|
2018-12-06 01:59:38 +00:00
|
|
|
-p # preserving the original attributes of the copied files
|
2021-01-07 11:43:55 +00:00
|
|
|
-P # connection port
|
2018-12-06 01:59:38 +00:00
|
|
|
-q # hidden the output
|
|
|
|
```
|
|
|
|
|
|
|
|
### Commands
|
|
|
|
|
2018-12-25 12:27:52 +00:00
|
|
|
```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
|
|
|
|
```
|
2018-12-06 01:59:38 +00:00
|
|
|
|
2018-12-25 12:27:52 +00:00
|
|
|
```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
|
|
|
|
```
|