Icon^M file on Mac OS X

On mac, I sometimes find a file called Icon^M . The one I have in front of me right now is empty.

Now, I can guess it's probably a file to contain... an icon, most probably the personalized icon for the folder, but why the wacky name with the control-M at the end ?


These Icon\r files are still in use on modern MacOS X today. They are generally invisible but sharing tools like Dropbox can cause them to become exposed as the hidden attribute assoicated with them may not be propagated with the file. More information about them can be read in the Icon? file on OS X desktop superuser question.


You're right: According to haxx.se, this filename was the old (OS 9) way to have a personalized icon for a folder.


You can temporarily clean them up with: find . -name Icon$'\r' -delete But that isn't a solution.

If it is an older HFS+ file system, you can enter the following in tTerminal to prevent writing Mac junk to the network shares: defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true but that doesn't work with APFS. :(

Why is this not being looked at as a MacOS problem, rather than blaming Google Drive?

I am also encountering this problem with one of our developers (MacOS Catalina). It's driving me bonkers because every file or folder that is created from Mac Finder, while in Google Drive, creates these "Icon/?" files.

Does anyone actually know how to stop this unwanted and anachronistic behavior from happening on APFS?