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

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

安装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 /
登录后复制

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

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

08-30 13:17