Scp 命令
阅读量:
用来在不同服务器之间复制文件或文件夹
- 本地和远程服务器之间
- 通过本地在两个远程服务器之间
scp [OPTION] [user@]SRC_HOST:]file1 [user@]DEST_HOST:]file2
-
OPTION
- scp options 不同的传输设置,常用的有:-
-P
- Specifies the remote host ssh port. -
-p
- Preserves files modification and access times. -
-q
- Use this option if you want to suppress the progress meter and non-error messages. -
-C
- This option forcesscp
to compresses the data as it is sent to the destination machine. -
-r
- This option tellsscp
to copy directories recursively.
-
-
[user@]SRC_HOST:]file1
- 源文件 -
[user@]DEST_HOST:]file2
- 目标文件
复制多个文件
从远程服务器到本地
$ scp your_username@remote.edu:/some/remote/directory/\{a,b,c\} ./
$ scp your_username@remote.edu:/some/remote/directory/'a,b,c' ./
从本地到远程服务器
$ scp foo.txt bar.txt your_username@remotehost.edu:~
$ scp {foo,bar}.txt your_username@remotehost.edu:~
$ scp *.txt your_username@remotehost.edu:~
#待整理笔记
反向链接
到头儿啦~