Categories
CLI Miscellaneous

Delete Icon? icon\r files from your Mac

For the longest time these “Icon?” (or Icon\r) files kept popping up on my Mac without any rhyme or reason. I would manually delete them. Eventually i got fed up again when several popped up in my main Music folder and all its sub-directories.

I googled a Terminal (bash) command to find and delete files based on name. So, here is the command i settled on for my needs. Be sure to change the directory to whatever one you need:

find Google\ Drive/ -name 'Icon?' -delete

Oh, in case you don’t know how to run this or would like more info into as to what the command actually means:

  • Use Spotlight to search and open Terminal.app (Command+Space bar)
  • ‘find’ looks for file(s) based on certain parameters
  • ‘Google\ Drive/’ is the convention for a folder that has a space in its name; here i’m saying to look for files in my Google Drive folder
  • ‘-name’ is telling the ‘find’ command to look for file(s) based on its name
  • ”Icon?” is the filename you’re looking for; in this case it’s the annoying ‘Icon?’ files that spawn outta the blue
  • ‘delete’ is saying to delete the files that are found

I hope that helped you to delete Icon? files! These obnoxious Icon? files need to go away! Might have to setup an automatic job to run once daily or something. Maybe that’ll be the next blog post.

Peace.

(Visited 66 times, 2 visits today)
3 2 votes
Article Rating
Subscribe
Notify of
guest
3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
nana
1 year ago

hello thanks for the solution

kisspng-bumblebee-optimus-prime-wheelie-transformers-rende-transformers-5abc6374db2f05.6537812715222956688978.jpg
nana
1 year ago

thx really

bill prusak
bill prusak
6 months ago

How to delete of change file icons, mac puts a icon as part the file. Irritating!