Remove foreign language files to save disk space

Mar 26, '01 11:10:11PM

Contributed by: Anonymous

[Editor's note: I have replaced the original method listed here with a much safer version. The "find" command line hack removes some Epson and Apple files that also end in ".lproj".]

If you plan on using your machine for only English (or only one of the other languages), you can safely remove the foreign language files (*.lproj) from your drive, freeing up over 200mb of space. "Since EBCDIC" posted a script in this MacFixit forum thread that does the trick.

Read the rest of the article for the how-to!

You need to create a very simple "shell script". Open a terminal, make sure you're in your home directory ('cd" then return), and use your favorite editor to create the following file. Pico is the easiest edit to use, so if you're new to the terminal, try typing "pico nolproj" and then copying and pasting the following:


foreach language ( French Dutch Spanish Italian Swedish Portuguese German )
find / -name $language.lproj -type d -exec rm -r -- {} ; -prune
Save the file, quit the editor, then type:
chmod +x nolproj
This makes the file executable. You can now run it by typing
sudo ~/nolproj
and entering your password.

The above script keeps all English files; if you want to keep a few, or a different one, just edit the language list and REMOVE those languages you want to KEEP. Anything in the list is DELETED.

Caution! Make sure you type the file exactly as shown! A simple little typo could delete all the files on your hard drive! Read the MacFixIt forum for a real-world example of how this could happen to you!

Comments (14)

Mac OS X Hints