Yum : searching for a package with binary name

Is there a way to search a package using the binary name.

for example I want to find rpm package for command "ls" then it should be coreutils-6.9-10.4.i586 for example.


The yum command "whatprovides" accepts wildcards. If you're searching for the package that provides as certain file or executable and do not know its full path, use "yum whatprovides */filename".

$ yum whatprovides */ls

coreutils-5.97-23.el5_4.2.x86_64 : The GNU core utilities: a set of tools
                                 : commonly used in shell scripts
Repo        : installed
Matched from:
Filename    : /bin/ls

yum provides /bin/ls
repoquery -f /bin/ls

...will both dtrt. Also recent versions of "yum" will automatically do a number of file lookups if you do:

yum provides ls