Simple script to delete specific files

Posted:
in Genius Bar edited January 2014
I just moved a share point from an SMB (Windows 2000) server over to an AFP server (OS X server) The share contains lots of sub folders. My Mac users had too many weird issues with saving Illustrator files to the SMB share, so it makes sense to just move them to a more Mac-friendly environment. Anyway...



Due to it's SMB past, there are lots of "icon" files (stripped from resource forks, etc). I'd like to tidy-up and get rid of those "icon" files. I need to write a simple script that looks for any file named "icon" and remove/delete them (rm). It needs to be recursive, so that the script can clean all the sub folders on the share point from top to bottom. I'd love to get some ideas from you guys on the best way to approach this. I'm an experienced admin, but I dont do much scripting. The share point is small (800 MB), but it has a lot of files and tons of sub-folders (they are very well organized users/workflow).

Comments

  • Reply 1 of 1
    rara Posts: 623member
    Open a terminal window, move to the root directory where all the files are, and execute the following:

    Code:


    find . -name icon -delete



Sign In or Register to comment.