

when parsing your software sources files in /etc/apt// - only files with the *.list extension get parsed all others are ignored. However, even some parts of the operating system rely on file name extensions, e.g. Whether this is a bug or a feature can be discussed. An example is the Eye of Gnome ( eog, standard picture viewer) which determines the image format by the file extension and throws an error if it does not match the content.

So normally the operating system relies on the file content and not its name to determine the file type, but stating that file extensions are never needed on Linux is only half of the truth.Īpplications may of course implement their file checks however they want, which includes verifying the file name and extension. This special comment tells the system with which application to open the file. (basically everything that treats lines starting with # as comment) may contain a shebang like #!/bin/bash as first line. Scripts in most scripting languages like Bash, Python, Perl, AWK, etc. bmp) must start with the letters BM in their first two bytes. the part of the file name after the normally last period) and instead determines the file type by examining the first few bytes of its content and comparing that to a list of known magic numbers.įor example all Bitmap image files (usually with name extension. Usually Linux does not rely on file names (and file extensions i.e. There is no 100% black or white answer here.
