deleting junk and cache

For every folder you open in Finder it saves a .DS_Store file in that folder with the window settings , here is a easy way to get rid of them (texts in bold are shell commands to be put into Terminal ) the command recursively traverses all the directories , you can replace all the path with / for a system wide cleanup

find /Volumes/myvolume/mydir -name “.DS_Store” -print0 | xargs -0 rm -v

Like all operating systems there are some caches on osx that you might sometimes want to get rid off , to do so :
rm -rfv ~/Library/Caches/
removes all caches for the logged in user
sudo rm -rfv /System/Library/Caches/ /Library/Caches/
removes some system wide caches
sudo rm -rfv /private/var/folders/
removes Leopard specific cache folders
The osx kernel is a modular one meaning extensions are loaded into it as needed , to speed things up especially at boot caches are made that from time to time you might want to clear
sudo rm /System/Library/Extensions.kextcache /System/Library/Extensions.mkext /System/Library/Extensions/Caches/com.apple.kext.info
Advertisements