I’m writing a short primer or how to, on cleaning up and a tune up for Mac OSX using the Terminal. Most of these can be accomplished by using Finder or some type of all-in-one application but I prefer to use Terminal and do everything in one shot, plus it saves time. These commands below should be enough for now, eventually I’ll add more articles as times permits on more terminal tricks for Mac OSX. If you don’t know a certain command on terminal using the “man” command along with the command you need help with will show you the information you need to use the command. (Using man pages is suggested if you are un-familiar with a certain command.)
WARNING! The “sudo rm -f” command is VERY dangerous, and can cause data loss if used incorrectly.
1. Delete all system log files (consoles logs): sudo rm -rf /private/var/log/*
2. Delete Quicklook cache (File previewer): sudo rm -rf /private/var/folders/
3. Delete temp files: cd/private/var/tmp/; rm -rf TM*
4. Delete System-wide caches (web history, app cache..): cd ~/Library/Caches/; rm -rf ~/Library/Caches/*
5. Run maintenance Cron tasks : sudo periodic daily weekly monthly
6. Flush Directory Service(s) resolver cache (DNS, etc..): dscacheutil -flushcache
7. Update Application pre-binding: sudo update_prebinding -root / -force
8. Repair Disk Permissions on boot volume: sudo diskutil repairpermissions /