Remove Unneeded Languages in Mac OS X

By | 03/09/2009

I ran into this little tip today on Command-Line-Fu.  It automagically finds and deletes all non-english language sets installed on your machine.  This is, of course, a Mac OS X tip so you wont get very far running it on your Linux machine.  I have two OS X desktops at home so I found it applicable.  I know there are quite a few of you closet OS X users out there as well.  We’ll just let this one be our little secret.

sudo find / -iname "*.lproj" -and ! -iname "en*" -print0 | tee /dev/stderr | xargs -0 rm -rfv

Can anyone suggest making this command any more efficient?  Just looking at it (without testing) I may have tried something like this:

sudo find / -iname "*.lproj" -and ! -iname "en*" -exec rm -rf {} \;

note: replace the “en*” with the language you want to keep if other than english.  Also replace -exec with -ok if you want to manually OK the deletion of any/all files found.

Leave a Reply

Your email address will not be published. Required fields are marked *