Remove icon from file/folder on Mac OS X

Alec Jacobson

July 27, 2009

weblog/

I was messing with the icon of my external drive and managed to lose the ability to change or reset the icon using "Get info" in the GUI. I found a way to forcibly remove the icon, and in doing this found a nice way to change icons outside the GUI.
To remove a file's icon or in this case my volume's icon:
in a Terminal cd into that Volume, usually /Volume/[drive name]/, then remove the icon file called .VolumeIcon.icns with the command:
rm .VolumeIcon.icns
This prompted me to examine what icon files for regular files look like, for a tiff image called green.tiff the icon file was in the same folder called ._green.tiff. I wanted my volume to have the same icon as this tiff image, only the transparency wasn't showing up correctly. It showed up correctly in the tiff file's icon, but not when I copied the icon using "Get info" to the volume. On the command line I was able to give my volume a transparent icon from a tiff file by simply coping the icon file of the image onto the icon file of the drive:
 cp ._green.tiff .VolumeIcon.icns 
Update: Might as well post the transparent icon images I changed my volume icons to. The idea was to have the color of the drive match the USB cord attached to the computer:
Red Drive IconGreen Drive IconBlue Drive IconPink Drive IconYellow Drive IconTeal Drive IconPurple Drive IconBlack Drive Icon

Download a folder containing all of the above read to use