Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 http://freedesktop.org/ .
> 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

1 Answer 1

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

$HOME/.local/share/mime
/usr/local/share/mime
/usr/share/mime

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

EDIT:

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

 
discard

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.