Back in the early 1980s, DOS filenames couldn’t be more than 8 characters long with a period and a 3-character extension. That was limiting, so when Apple developed the Mac operating system in 1984, it allowed longer names and eliminated the need for an extension, although Mac OS X’s Unix roots meant a return of the filename extension in 2001. Since then, filename restrictions have loosened to the point where it’s easy to think that they no longer exist.
If only that were true! In some ways, the situation has become even cloudier, thanks to additional limitations from file-sharing services like Dropbox, OneDrive, and Box. If you’re sending a file from your Mac to a Windows user through Dropbox, you need to make sure that all three can deal with the filename.
At least length isn’t something that you generally have to think about these days, since both macOS and Windows—and the cloud services—accept filenames up to 255 characters in length. Technically speaking, Windows limits directory paths (the enclosing folder names along with the filename) to 255 characters, but even still, that shouldn’t be difficult to avoid.
What could go wrong if you run afoul of a naming restriction? macOS and Windows may simply not let you type the character—for example, you can’t put a colon in a Mac filename. Putting a period at the start of a Mac or Unix filename will hide the file. Cloud sharing services might rename the file, or you might encounter syncing issues where files don’t appear where they should. Certain characters can also cause trouble when files are used at the command line.
Here are the characters to avoid and the operating systems and services that prohibit them:
: (colon): macOS, Windows, Dropbox, OneDrive, Box
. (period): macOS (at the start of a name), Dropbox