how to identify file nature

Asked by KKevin901

Learn from some Linux documents that Ubuntu does not use the file extension of a file to identify the file nature.

Perception on Windows environment too deep. Just curiosity how the system (Ubuntu) and user distinguish or identify what program should be used to open a file. I took a mpeg file with the "film" file icon and .mpeg file extension. Remove the .mpeg file extension, it still can be open with Mplayer as normal. But when I append .mp3 file extension, the file icon view changed to music icon. It can be open and play with music player program such as Rythmetic.

All the reason I did that is because. I download a shoutcast file and name with .mp3 extension. Then play back on Ubuntu Mplayer without problem. But it cannot play when I load it to a portable MP3 player. After couple trials, then I realize it is actually a mpeg file instead of mp3 file.

Enjoy the new world of computer outside Windows. Looking for some advise and explanation.

Thanks

Kevin

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
KKevin901
Solved:
Last query:
Last reply:
Revision history for this message
tmc1961 (tmc1961) said :
#1

I would like to know too, most curious! post this on the launch pad, may get better results

Revision history for this message
Florian Diesch (diesch) said :
#2

Linux specifies only how to identify executables: A file is executable if you have permission to execute it. For anything else a application can do whatever it wants. Most applications use the file extension as a hint of the file type, some - like mplayer - are a bit smarter and use the file's content instead of its name.

Nautilus (Gnome's standard file manager) seems to use the file extension if it is a known one and the file's content otherwise.

Revision history for this message
KKevin901 (kkevin901) said :
#3

Dupilcate quetion entry. Answered and solved on the other thread.