Linux scp命令

Linux scp命令用于Linux之间复制文件和目录。

scpsecure copy的缩写,scp是Linux系统下基于ssh登陆进行安全的远程文件拷贝命令。

语法

scp [-346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
         [-l limit] [-o ssh_option] [-P port] [-S program] source ... target

举例

从本地复制到远程

# 拷贝文件
scp /home/test/test.txt root@192.168.0.2:/home/test/
# 拷贝目录
scp -r /home/test/ root@192.168.0.2:/home/test/

从远程复制到本地

# 拷贝文件
scp root@192.168.0.2:/home/test/ /home/test/test.txt
# 拷贝目录
scp -r root@192.168.0.2:/home/test/ v/home/test/
原文地址:https://www.cnblogs.com/xgo0104/p/10771973.html