|
|
Q: Script to remove lproj files?
|
|
|
|
Dedicated MacNNer
Join Date: Feb 2003
Status:
Offline
|
|
The Finder Find doesn't seem to be able to search within .apps, even when given a specific directory, so I was thinking of a shell script taht I can daisy chain. ie.
find all french.lproj in /Applications and delete
find all russian.lproj...
etc.
I know Youpi and other apps exist. Thanks.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Sep 2001
Location: Chico, CA and Carlsbad, CA.
Status:
Offline
|
|
Popular topic. The exact command had escaped me until I did a simple search on google. This should work:
Code:
find / \! -name "English.lproj" -name "*.lproj" -type d -exec rm -rf -- { } \; -prune
This works well, but it's not perfect. If you actually run it as root you'll end up deleting a lot of stuff that probably shouldn't be deleted. Just run the following command (with the delete stuff taken out) to see exactly what will be deleted.
Code:
find / \! -name "English.lproj" -name "*.lproj"
Just be careful, some applications may break if you go deleting files all willy nilly! It's only a couple hundred megs anyways
Maybe someone has a better method (or a sweet regular expression, I don't do regex, hah!).
|
"In Nomine Patris, Et Fili, Et Spiritus Sancti"
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Feb 2003
Status:
Offline
|
|
That's a great start, thanks a lot.
|
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status:
Offline
|
|
I've been toying with this myself, and if you'd like to know what languages are most common on your system, run
Code:
find / -name "*.lproj" -exec basename {} \; | sort | uniq -c | sort -r
This will find all of the .lproj folders, count them, and list them in order of most to least numerous.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Sep 2001
Location: Chico, CA and Carlsbad, CA.
Status:
Offline
|
|
Originally Posted by wataru
I've been toying with this myself, and if you'd like to know what languages are most common on your system, run
Code:
find / -name "*.lproj" -exec basename {} \; | sort | uniq -c | sort -r
This will find all of the .lproj folders, count them, and list them in order of most to least numerous.
Hey that's pretty cool, thanks.
|
"In Nomine Patris, Et Fili, Et Spiritus Sancti"
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status:
Offline
|
|
I played around with this stuff some more and came up with these functions:
Code:
function flproj () {
if [[ -d "$1" ]]; then
LOC="$1"
else
LOC="$PWD"
fi
find "$LOC" -name "*.lproj" -exec basename "{}" \; | sort | uniq -c | sort -r
}
function rmlproj () {
if [[ -d "$1" ]]; then
LOC="$1"
else
echo "USAGE: rmlproj DIR LANG"
return 1
fi
until [[ -z "$2" ]]; do
echo "Deleting all $2.lproj in $LOC"
find "$LOC" -name "$2.lproj" -exec rm -rf "{}" \; 2> /dev/null
shift
done
}
Put those in your ~/.profile and you can use them to single out and delete the most numerous .lproj folders.
By the way, what happened to [ code] blocks being non-wrapping and whitespace-preserving?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|