Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In the Debian family of OSes, dpkg --search /bin/ls gives:

coreutils: /bin/ls

That is, the file /bin/ls belongs to the Debian package named coreutils. (see this post if you are interested in a package containing a file that isn't installed)

What is the Fedora equivalent?

share|improve this question
up vote 45 down vote accepted

You can use rpm -qf /bin/ls to figure out what package your installed version belongs to:

[09:46:58] ~ $ rpm -qf /bin/ls
[09:47:01] ~ $ 

Update: Per your comment, the following should work if you want only the name of the package (I just got a chance to test):

[01:52:49] ~ $ rpm -qf /bin/ls --queryformat '%{NAME}\n'
[01:52:52] ~ $ 

You can also use yum provides /bin/ls to get a list of all available repository packages that will provide the file:

[09:47:01] ~ $ yum provides /bin/ls
Loaded plugins: fastestmirror, langpacks, presto, refresh-packagekit
Adding en_US to language list
Loading mirror speeds from cached hostfile
 * fedora: archive.linux.duke.edu
 * rpmfusion-free: mirrors.tummy.com
 * rpmfusion-free-updates: mirrors.tummy.com
 * rpmfusion-nonfree: mirrors.tummy.com
 * rpmfusion-nonfree-updates: mirrors.tummy.com
 * updates: mirror.vcu.edu
coreutils-8.5-6.fc14.i686 : A set of basic GNU tools commonly used in shell
                          : scripts
Repo        : fedora
Matched from:
Filename    : /bin/ls

coreutils-8.5-7.fc14.i686 : A set of basic GNU tools commonly used in shell
                          : scripts
Repo        : updates
Matched from:
Filename    : /bin/ls

coreutils-8.5-7.fc14.i686 : A set of basic GNU tools commonly used in shell
                          : scripts
Repo        : installed
Matched from:
Other       : Provides-match: /bin/ls

[09:47:01] ~ $
share|improve this answer
Is there a way to have rpm display owners of a file without providing a full path? You wanna add a note to that effect? – Tshepang Dec 10 '10 at 7:27
@Tshepang: I think you should be able to add --queryformat '%{NAME}' to accomplish that, but I haven't tested it myself. I can do a quick test and update this after work, though. In the meantime, you might find the info here useful: rpm.org/max-rpm/s1-rpm-query-parts.html – eldarerathis Dec 10 '10 at 14:25
Just wanted to add that OpenSuSE's zypper has a what-provides feature that accomplishes this task. This question comes up first when doing a search, so it would be handy to have this answer even though the question is specific. – casualunixer Apr 4 '12 at 2:14
For fedora 22 "dnv provides filename" also works – Trismegistos Aug 12 '15 at 19:59

Try searching for files using http://www.kodkast.com/applications/find-which-package-file-belongs-to

This is an application to search for files which are contained in different rpms/linux packages, and is very useful when you dont even have the rpm installed on your machine.

share|improve this answer
The domain is down, unfortunately. – Alois Mahdal Jul 6 at 18:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.