A file name is the complete title of a file and file extension. For example, "readme.txt" is a complete or full file name. A file name may also only describe the first portion of the file, for example, "readme" is the name of the file and ".txt" is the file name extension of the file.
In the above example, the first file shown in Explorer is "Regedit.exe," "Regedit" is the name of the file, and ".exe" is the file extension that identifies this file as an executable file. The next file "RtlExUpd.dll," which is a DLL file and another example of a file.
Invalid file name characters
Today, almost all programs support long file names and the file name can contain every character (including letters and numbers), except those shown below.
Invalid file name characters
/ \ : * ? " < > |
File names with spaces
Although all operating systems today support spaces in file names, a command line you may encounter errors because the command line doesn't know where the file name starts and ends. To prevent errors with file names with spaces, surround the file name with quotes when being used in a command line.
File names with capital letters
File names can contain uppercase and lowercase characters. However, the operating system that uses the files may be case sensitive. For example, Microsoft Windows is not case sensitive and treats all files the same regardless if they have all lowercase characters or some uppercase characters. However, Linux and macOS are case sensitive, which means the file "readme.txt" and "README.TXT" are treated as two different files even though they have the same file name.
When designing a web page or uploading any images or other files to the Internet, they are case sensitive. We always recommend keeping all your file names in all lowercase characters when they are used online to help prevent any confusion or errors.
What is the file name character length limit?
Every operating system has a limit to how many character can be used in a file name that is around 255 characters long. When determining the length of a file, both the file name and the file extension are used together to get the total length. For example, the file "myfile.txt" is ten characters long. Below is a list of Microsoft Windows versions and their file name character limits.
Windows 10 - 260 character limit.
Windows 8 - 260 character limit.
Windows 7 - 260 character limit.
Windows Vista - 260 character limit.
Windows XP - 255 character limit.
Windows 2000 - 254 character limit.
When renaming a file the full path and file name are used which means the directory names, separating slashes, and the file name should not exceed the above set limits (e.g., 260 characters).
Should I be using "file name" or "filename" in my writing?
Today, both "file name" and "filename" are widely used and accepted. The original form of the word was "file name" and "filename" became popular as more people and software programs began to use that version of the word. According to the Microsoft Manual of Style, a file name is "Two words both as an adjective and as a noun when referring to the name of a file. Do not hyphenate."
If you are referring to a programming term such as the FileName property or fileName variable, you should be using the same capitalization of the word in the program you're describing.
Should "file name" or "filename" be capitalized in my writing?
No. Unless "file name" is at the beginning of a sentence, no part of the word should be capitalized in your writing.