Super User is a question and answer site for computer enthusiasts and power users. 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

I cant find out what the parent package of the file command is. Need it installed on a Centos 6 OS.


share|improve this question

migrated from Jun 12 '12 at 5:08

This question came from our site for professional and enthusiast programmers.

Try sudo yum install file. – jww Jul 3 at 12:44

If you had file installed on one of your systems, than the following command would have answered your question

 rpm -q --whatprovides `which file`

In CentOS and other RedHat derived distributions the name of the package is file

 $ rpm -q --whatprovides `which file`

Edit 2 (after a comment from jww)

To install file type

 sudo yum install file

Edit 1 As @Miquel reminds in Debian and Ubuntu one can use dpkg-query -S:

 $ dpkg-query -S `which file`
 file: /usr/bin/file
share|improve this answer
Replace rpm -q with dpkg -S in debian/ubuntu/derivates – Miquel Jun 11 '12 at 14:11
@Miquel Thank you! – Dmitri Chubarov Jun 11 '12 at 14:32
The file progam is missing on CentOS 6 and 7: /usr/bin/which: no file in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin) I don't believe we can use which to locate it. And rpm -q --whatprovides "/usr/bin/file" results in error: file /usr/bin/file: No such file or directory. – jww Jul 3 at 12:40
@jww edited the post – Dmitri Chubarov Jul 6 at 18:25

You must log in to answer this question.