File name
A file name is the complete title of a file and file extension. For example, "readme.txt" is a complete file name. A file name may also describe only the first portion of the file. For example, "readme" is the name of the file, and ".txt" is its file name extension.
In the example above, the first file shown in Explorer is Regedit.exe. "Regedit" is the file name, and ".exe" is the file extension, identifying as an executable file. The next file, "RtlExUpd.dll," a DLL (dynamic-link library) file, is another example.
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
/ \ : * ? " < > |
Also, many operating systems, including Windows, have reserved words to also not be included in a file name. See the reserved word definition for examples of reserved words.
File names with spaces
Although all operating systems today support spaces in file names, a command line 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 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, meaning the file "readme.txt" and "README.TXT" are treated as 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 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 is limited to how many characters can be used in a file name (typically 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 are 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 set limits above (e.g., 260 characters).
Linux operating systems have a 255 character limit for a file name, and a 4,096 character limit for the full path and file name combined.
Should I use "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 programs began using that version. 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."
With a programming term such as the FileName property or fileName variable, use 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.
8.3 format, File, File extension, Name, Operating system terms, Path, Untitled