欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  运维

bash scp:未找到命令的解决方法

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

bash 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 /

本篇文章到这里就已经全部结束了,更多其他精彩内容可以关注的其他相关栏目教程!!!

以上就是bash scp:未找到命令的解决方法的详细内容,更多请关注其它相关文章!

相关标签: bash