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

本文介绍了如何解决Linux系统中scp命令缺失的问题。首先通过yum provides命令查找scp命令所在的软件包,然后安装openssh-clients软件包来获得scp命令,并最终成功使用scp命令将文件从本地复制到远程主机。

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  
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值