Cheat Sheet速查表
跳转到主要内容

scp 速查表

本文根据 Devhints / scp 翻译。代码示例及版本范围沿用原文。原文标注更新日期:2018-12-25。

用法

scp <options> source_path destination_path

条件

-r      # transfer directory
-v      # see the transfer details
-C      # copy files with compression
-l 800  # limit bandwidth with 800
-p      # preserving the original attributes of the copied files
-P      # connection port
-q      # hidden the output

命令

$ 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
$ 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