查看命令属于哪一个安装包

1.使用scp命令从本地复制文件到另一台主机,提示没有scp命令。

[root@http ~]# scp /etc/hosts 10.0.0.129:/opt
bash: scp: command not found
[root@http ~]# which scp
/usr/bin/which: no scp in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

2.使用命令查看scp属于哪一个安装包

[root@http ~]# yum provides */scp
Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
openssh-clients-5.3p1-123.el6_9.x86_64 : An open source SSH client applications
Repo        : base
Matched from:
Filename    : /usr/bin/scp

3.安装scp命令

[root@http ~]# yum install openssh-clients -y

4.测试

[root@http ~]# scp /etc/hosts 10.0.0.129:/opt
The authenticity of host '10.0.0.129 (10.0.0.129)' can't be established.
RSA key fingerprint is 3a:b6:fd:7c:a0:cf:52:be:3e:5a:4a:ec:9a:60:8a:84.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.0.0.129' (RSA) to the list of known hosts.
root@10.0.0.129's password: 
hosts                                         100%  158     0.2KB/s   00:00  

猜你喜欢

转载自blog.csdn.net/liang_operations/article/details/81385892
今日推荐