Speed Up a Slow Terminal by Clearing Log Files
The Mac OS X Terminal can become slow to launch over time, but there’s an easy solution to speed it up again.
By deleting the Apple System Logs, you can shave the lag in opening and launching new Terminal windows/tabs dramatically, in my case from about a three second delay to instantaneous!
Here’s how to delete the log files and gain your Terminal launch speed back:
At the command line, use the following:
Now you’ll want to verify that you are in the proper directory by listing the .asl log files:
Finally, if only .asl files turn up as the result, type the following command to delete them:
sudo rm !$
Update: we adjusted the above commands per user comment, it is now safer for more novice users. Here’s the old command maintained for posterity, it’s been struck out because it’s a bit more risky for beginners to follow:
At the command line type the following:
then, inside that directory, type:
sudo rm -rf *.asl
Warning: be absolutely certain that you only type the sudo rm -rf command INSIDE the /var/log/asl/ directory! rm -rf * deletes all files in a directory, no questions asked, so if you perform that task in the wrong directory (like home folder) you are going to have a serious problem! I’m assuming you have moderate experience in the command line environment – if you do not, you probably won’t need this tip anyway.
Update: As Marc points out in the comments, it’s safer to specify deleting only the log files. Above command has been altered to reflect this. An alternative and shorter command is this one:
sudo rm -rf /private/var/log/asl/*.asl