Ubuntu – How to change the MIME type for a file

mime-type

I have a file that is formatted as a .doc, but Nautilus and LibreOffice insists that it is a .txt. Both precise and Ubuntu 12.10 are that way, but Google Docs can convert it (after playing with it).

enter image description here

enter image description here

enter image description here

Best Answer

To check if 'extension' mime type exist:

grep 'extension' /etc/mime.types

To create new mime type:

  1. Open /etc/mime.types with text-editor(with root privileges)

    gksudo gedit /etc/mime.types

  2. Add extension to /etc/mime.types in following format:

    text/extension extension

For more info click here