Linux common commands-23: scp

scp is the abbreviation of secure copy . It is a secure remote file copy command based on ssh login under the linux system. It can copy files and directories between linux servers.

Syntax format: scp [parameter] [file]

Common parameters:

Example

 # 将当前目录下的test.py拷贝到远程主机/home目录下scp test.py root@192.168.1.100:/home # 将当前目录下的文件夹test拷贝到远程主机/home目录下scp -r test root@192.168.1.100:/home # 从远程主机拷贝文件到本地scp root@192.168.1.100:/home/test.py . # 从远程主机拷贝文件夹到本地scp -r root@192.168.1.100:/home/test /tmp # 使用非标准ssh端口拷贝scp -P 1024 test.py 192.168.1.100:/home/xgx/

This article is reprinted from https://xugaoxiang.com/2022/06/06/linux-cmds-23-scp/
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment