Linux – one prefer lower case file extensions like .jpg over uppercase ones like .JPG

file extensionlinuxstandards

Many (most?) programs note file extensions in lower case. ls command in bash even prints foo.jpg highlighted as picture by default but not *.JPG.

Lower case characters are better to distinguish from each other because they make use of descenders.

Is there a standard or convention that suggests to prefer lower case file extensions on Linux systems?

(similar, but different question: https://softwareengineering.stackexchange.com/questions/186313/lowercase-in-linux-file-names)

Best Answer

The following naming conventions should be observed.

  • All file names should be in lower case.
  • EXCEPTION: Plain text files such as README, INSTALL, NEWS, AUTHORS
  • Do not use spaces in file names. Use either a '-' or a '_'.
  • Use only alphanumeric characters, periods, underscores and hyphens. Make file names concise.
  • Avoid overly long and complex file names. Avoid Camel Case. (Capitalizing the first letter in each word. Ex. ThisIsCamelCase.sh)
  • Use the same extension for each file type. (.jpg vs .jpeg)

These rules have become industry convention because you just never know how someone else's code will handle file names. Will file names with spaces break something? Will it recognize .jpg's while ignoring .jpeg files? Remember, filenames are case sensitive. Readme is not the same file as README. The nice thing about conventions, once you know them, is that they save you time as there's no need to ponder how your files will be named. 

http://www.linfo.org/file_name.html

http://docs.oracle.com/html/B13786_01/ap_k.htm

http://www.cyberciti.biz/faq/linuxunix-rules-for-naming-file-and-directory-names/

http://gcc.gnu.org/onlinedocs/gcc-3.4.4/gnat_ugn_unw/File-Naming-Rules.html

Related Question