Force nautilus to ignore extensions

Solution 1:

  1. As you have noted, yes, Nautilus use file extension (when present) as a priority to determine the file type.

  2. You can edit the file /usr/share/mime/packages/freedesktop.org.xml, search for the extension you want to ignore and delete the line. Below is an example.

Supose I don't want Nautilus to associate ".txt" extension and I want it to look at the "magic number" instead.

I. Edit the file:

sudo gedit /usr/share/mime/packages/freedesktop.org.xml  

I will look for a line with <glob pattern="*.txt"/> and delete it:
enter image description here

II. Save.

III. Run:

sudo update-mime-database /usr/share/mime  

Done!

== Effect ==

This is how an mp3 file looks like:

enter image description here

This is how it looks if I change the extension to txt:

enter image description here

This is how it looks if I edit the file above and then change the extension:

enter image description here