如何知道命令是由哪个服务提供的

[root@ks-server ~]# system-config-kickstart
bash: system-config-kickstart: command not found...


[root@ks-server ~]# yum whatprovides "system-config-kickstart" Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirror.its.sfu.ca * updates: mirrors.aliyun.com system-config-kickstart-2.9.7-1.el7.noarch : A graphical interface for making kickstart files Repo : base

当输入一个命令提示  command not found...

可以使用  yum whatprovides 来查找是由哪个软件包提供此命令;

如果命令以存在;可以用 yum whatprovides  来查找是由哪个软件包提供,还能知道路径

[root@ks-server ~]# yum whatprovides "ifconfig"
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.xtom.com
 * updates: mirrors.aliyun.com
extras/7/x86_64/filelists_db                                                        | 249 kB  00:00:01     
net-tools-2.0-0.22.20131004git.el7.x86_64 : Basic networking tools
Repo        : @anaconda
Matched from:
Filename    : /usr/sbin/ifconfig

 

yum provides也可以查询出结果

[root@ks-server ~]# which "ifconfig"
/usr/sbin/ifconfig
[root@ks-server ~]# rpm -qf /usr/sbin/ifconfig
net-tools-2.0-0.22.20131004git.el7.x86_64

先用 which 查出命令路径

然后用  rpm -qf  也可以指向软件包

posted @ 2019-08-13 16:42  25℃  阅读(243)  评论(0编辑  收藏  举报