But relying on them to tell the OS what type a file is, or allowing them to change the extension, isn't good either. lena.jpg doesn't become lena.pdf by changing the last 3 letters of the filename..
It gets really complicated when you get into overlapping file types, like with ISOBMFF. An .mp4 can also, simultaneously, be a valid .3gp because those are profiles of ISOBMFF. On the other extreme, JPEG is secretly two different incompatible formats (JFIF and Exif), and a video file with a different codec in the same container, or even a different track layout, might as well be a different format.
Some file formats, eg png, require a particular file header in order to be considered valid. This is true regardless of your operating system, be it windows or linux. If that is hidden information, then it is hidden regardless of which operating system you're on. On windows, if I have a png named .doc, then there is absolutely no way to determine that it is a valid png and could be opened with my image viewer with standard tools. On linux it will recommend you open the file with an image viewer regardless of the file extension. That seems to me like significantly less hidden information.
> On windows, if I have a png named .doc, then there is absolutely no way to determine that it is a valid png
And that's a good thing. Imagine receiving a file called "very_funny_cat.png" and Linux realizing that while it's not a valid PNG image, it is a valid ELF executable.
The sane option would be to change the file explorer to have a column/field of "What type of file we've detected it is". We already do this for directories. Nowadays we just rely on naming convention that the last 3 letters of the name identifies correctly what the file format is.
Right, linux should instead go by the normal extension for an elf, which is no extension... instead this problem is solved by prompting the user if they want to execute the program.