CentOS 查看某个命令属于哪个工具包
有时候,我们只知道某个命令的名称,但是不知道这个命令属于哪个工具包。
如果我们要查找某个命令属于哪个工具包,可使用如下命令:
yum provides [command]
例如,我们要查找 htpasswd 这个命令所属的安装包:
[root@versatile ~]# yum provides htpasswd
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Determining fastest mirrors
httpd-tools-2.4.6-93.el7.centos.x86_64 : Tools for use with the Apache HTTP Server
Repo : base
Matched from:
Filename : /usr/bin/htpasswd
httpd-tools-2.4.6-95.el7.centos.x86_64 : Tools for use with the Apache HTTP Server
Repo : base
Matched from:
Filename : /usr/bin/htpasswd
httpd-tools-2.4.6-97.el7.centos.x86_64 : Tools for use with the Apache HTTP Server
Repo : updates
Matched from:
Filename : /usr/bin/htpasswd
httpd-tools-2.4.6-97.el7.centos.1.x86_64 : Tools for use with the Apache HTTP Server
Repo : updates
Matched from:
Filename : /usr/bin/htpasswd
httpd-tools-2.4.6-97.el7.centos.2.x86_64 : Tools for use with the Apache HTTP Server
Repo : updates
Matched from:
Filename : /usr/bin/htpasswd
httpd-tools-2.4.6-97.el7.centos.2.x86_64 : Tools for use with the Apache HTTP Server
Repo : @updates
Matched from:
Filename : /usr/bin/htpasswd
根据上面结果,知道了 htpasswd 属于httpd-tools这个安装包,接下来安装即可:
yum install httpd-tools -y