Run The Maintenance Apps
Mac OS X includes maintenance routines that run in the background. Their job is to delete the system files that are no longer needed. This process also includes removing older information from the log files or deleting certain temporary files. These tasks will run in the middle of the night but if you happen to switch your computer off at that time then these tasks will never run, so you should run them manually. To run them, go to the Terminal and type in the following command:
sudo sh /etc/daily (Enter)
As you hit the Enter key, the Terminal asks for your administrator password, enter it. This command will initiate the cleaning job for your system, which will include cleaning various databases and logs and temporary files and more. This cleaning job will help your OS X in keeping things better
The three routines are run from Terminal using the commands below. Type in one command at a time, press Return, and when Terminal asks for your administrator password, enter it. As should be obvious, the first routine is meant to run every day, the second weekly, and the third monthly. In practice, no harm seems to be done running all three at the same time, once a month or so. This trio cleans up various logs and databases, helping OS X keep things in better order.