Server Fault is a question and answer site for system and network administrators. 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

When I run the following command mimetype -DM --database /usr/share/misc/magic /path/to/reset.css I expect to see text/css as a result but instead I get text/plain. Is there a way to fix this?

EDIT Removing -M didn't change anything

root@srv /var/www/vhosts/zf2skeleton # mimetype -D --database /usr/share/misc/magic module/Application/public/css/bootstrap.min.css 
> Data dirs are: /usr/share/misc/magic
> Checking inode type
WARNING: You don't seem to have a mime-info database. The
shared-mime-info package is available from .
> Checking globs for basename 'bootstrap.min.css'
> Checking for extension '.min.css'
> Checking for extension '.css'
> File exists, trying default method
module/Application/public/css/bootstrap.min.css: text/plain
share|improve this question

The manpage you linked to says it looks in the following locations for the database:


You can maybe figure out how to add an entry for CSS by looking at those directories.

After updating you have to run update-mime-database


You're using the -M switch which means it won't look at the file extension. It will look at the contents of the file only. A CSS file doesn't have a consistent header though so I doubt that will work.

share|improve this answer
There is already an entry in /usr/share/mime/test called css.xml – Optimus Feb 13 '12 at 20:22
Edited my answer. – sjbotha Feb 13 '12 at 20:25

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.