Best practice for naming files in Linux Updated on September 5, 2024 by InMotion Hosting Contributor 1 Minutes, 17 Seconds to Read If you are developing your website and you cannot find out why your pages, images, JavaScripts, and other web data is causing a 404 error not found, you may have a problem with case sensitivity. Linux servers are case sensitive. Windows servers are not case sensitive, so if you are moving your files from a Windows development platform to a Linux web platform you may need to watch out for the following common mistakes. Common Case Sensitive errors Mixing Upper case and lower case A common mistake is naming files a mixture of upper case and lower case. Like the following: MyFileName.html Linux reads the file name exactly the way its typed. So, MyFileName.html Is NOT the same as: myfilename.html Incorrect types file extension File extensions are case sensitive as well. Some file types have 4 letters and others 3. See the following example: Likewise, file extensions need to be exact as well: MyFileName.HTML Is NOT the same as: myfilename.html Also, image extensions must be the right type: image.jpg Is NOT the same as: image.jpeg Best practices for Linux file naming To prevent running into problems with your file paths on your site, we recommend following the best practices for file naming. See the below: Name all your files lower case. Instead of using a space, use an ( _ ) or a ( – ) Use consistent file types. Use jpg or jpeg. Don’t use both. Only alphanumeric characters, periods, underscores and hyphens and don’t use symbols like “%”, “$”, and so forth. Keep the file names short and descriptive. Share this Article Related Articles Understanding Linux Operating Systems How to Install Python 3.9 on CentOS 7 Speed Up grep Searches with LC_ALL=C How To Install RubyGems On Linux unrar and rar Commands 5 Ways to Find a File in Linux Setting Your PHP Settings in Command Line How to Check the Memory Usage on Linux How to Send Files to the Trash Can in Linux with Gio Trash How to Merge PDF Files in the Linux Terminal