3

Linux常用命令-23:scp

 1 year ago
source link: https://xugaoxiang.com/2022/06/06/linux-cmds-23-scp/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

scpsecure copy 的缩写,是 linux 系统下基于 ssh 登陆进行安全的远程文件拷贝命令,它可以在 linux 服务器之间复制文件和目录。

语法格式:scp [参数] [文件]

常用参数:

80bef62f94d26d7c.png
# 将当前目录下的test.py拷贝到远程主机/home目录下
scp test.py [email protected]:/home

# 将当前目录下的文件夹test拷贝到远程主机/home目录下
scp -r test [email protected]:/home

# 从远程主机拷贝文件到本地
scp [email protected]:/home/test.py .

# 从远程主机拷贝文件夹到本地
scp -r [email protected]:/home/test /tmp

# 使用非标准ssh端口拷贝
scp -P 1024 test.py 192.168.1.100:/home/xgx/

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK