Find out what package some command belongs to (on RPM systems)

rpm -qif `which more`
Replace 'more' command with any command which is in your PATH.
Sample Output
Name        : util-linux-ng                Relocations: (not relocatable)
Version     : 2.13.1                            Vendor: Fedora Project
Release     : 2.fc8                         Build Date: wto, 22 kwi 2008, 22:24:21
Install Date: pon, 5 maj 2008, 14:11:10      Build Host:
Group       : System Environment/Base       Source RPM: util-linux-ng-2.13.1-2.fc8.src.rpm
Size        : 5028446                          License: GPLv2 and GPLv2+ and BSD with advertising and Public Domain
Signature   : DSA/SHA1, pon, 28 kwi 2008, 21:31:42, Key ID b44269d04f2a6fd2
Packager    : Fedora Project
URL         :
Summary     : A collection of basic system utilities
Description :
The util-linux-ng package contains a large variety of low-level system
utilities that are necessary for a Linux system to function. Among
others, Util-linux contains the fdisk configuration tool and the login

By: alcik
2009-02-27 08:59:07

These Might Interest You

  • Find the package a file belongs to on an rpm-based distro. Show Sample Output

    whichpkg() { rpm -qf "$@"; }
    flatcap · 2011-07-05 23:39:32 2

  • 0
    equery belongs $( which mv )
    mrwill · 2011-02-11 22:50:15 0
  • Find which package a file belongs to on Solaris along with it's packaging system metadata. Show Sample Output

    pkgchk -l -p <full path to the file>
    sengork · 2009-07-04 08:22:11 0
  • This version builds on my command 8776 (Find the package a command belongs to on debian-based distros). So if you use that command to find package name then you could alternatively use following for package summary: function summpkg { dpkg -s $(whichpkg $1 | awk -F: '{print $1}'); } Show Sample Output

    function summpkg { dpkg -s $(dpkg -S $1 | egrep -w $(which $1)$ | awk -F: '{print $1}') ; }
    b_t · 2011-07-05 23:06:37 0

What Others Think

rpm -qif `which more` bash: rpm: command not found
TheBunman · 482 weeks and 2 days ago
Use of backticks deprecated in favour of $( ). a) backticks are harder to read b) $( ) can be nested More can be done than "which more": rpm -q --whatprovides /etc/sysconfig/msec msec-0.50.11-1.1mdv2009.0
mpb · 478 weeks and 4 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: