Skip to content

Remove Unneeded Languages in Mac OS X

 

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 "*.<span class="searchhit">lproj</span>" -and ! -iname "en*" -print0 | tee /dev/stderr | xargs -0 rm -rfv<br />

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 {} \;