scp命令用于通过ssh在两台服务器之间传输文件。大多数scp用户在系统中已经可以使用scp命令,但它仍然显示“bash:scp:command not found”。因此注意,scp命令必须在本地和远程系统上都可用才可以避免这个问题。

安装SCP命令包
scp命令来自Red Hat系统上的openssh-clients软件包,openssh-client软件包用于基于Debian的系统。可以使用以下命令在Linux操作系统上安装scp命令包。
CentOS / RHEL和Fedora
#yum install openssh-clients
Ubuntu和Debian
$ sudo apt-get install openssh-client
使用SCP命令传输文件
本地到远程:要将文件/opt/myfile.txt从本地传输到远程(remote.example.com)系统的/opt/directory,可以使用以下命令。
# scp /opt/myfile.txt remote.example.com:/opt/
远程到本地:要将文件/opt/myfile.txt从远程(remote.example.com)系统传输到本地系统/ opt目录,使用以下命令。
#scp remote.example.com:/opt/myfile.txt / opt /
本篇文章到这里就已经全部结束了,

阿里云CentOS/Windows服务器运维指南 | 阿里云腾讯云优惠活动 | 数据库优化教程-学派网








































评论前必须登录!
注册