Ubuntu – Making a symlink for a bin file and renaming it to “readme” (w/o extension) gives it text file properties

14.04binaryextensionsymbolic-link

When I create a symlink for a bin file(on Ubuntu 14.04 or 16.04) and rename it "readme", it shows as a link to text file. Also, when i checked the properties of this file, it says "Link to text/document". The strange thing is that the icon also changes to that of a text file from that of a bin file. Moreover, only when I change the filename to "readme" does that happen. If i rename the link to, say, "abc", it shows as a link to bin file with a bin icon.

Why is that?

Best Answer

File Naming in Linux

Excepts:

A relatively small number of file names on a system consist only of upper case characters, such as README, INSTALL, NEWS and AUTHORS. They are usually plain text files that come bundled with programs and are for documentation purposes.

There are files that are expected to be of a certain nature based on Linux File Naming Convention, these include names like README, AUTHOR, THANKS, INSTALL, CHANGELOG, NEWS e.t.c. I believe Ubuntu is enforcing those conventions and naming any file with those names will automatically give them certain properties following Linux Standards and conventions.

So its best to avoid naming files with those types of names. Please also look at man file to how that tool determines file types. You will find it a good read.

Source:

File Naming Conventions in Linux

README