devroom.io/content/posts/2011-11-08-fixing-a-slow-starting-terminal-or-iterm2-on-mac-os-x.md
2019-06-05 14:32:16 +02:00

25 lines
1.3 KiB
Markdown

+++
date = "2011-11-08"
title = "Fixing a slow starting Terminal or iTerm2 on Mac OS X"
tags = ["BASH", "shell", "MacOSX", "devops", "terminal", "terminal.app", "iterm", "iterm2", "zsh"]
slug = "fixing-a-slow-starting-terminal-or-iterm2-on-mac-os-x"
+++
For some time I have been annoyed with how slow my Terminal (in my case iTerm2) starts up. It would take 5-10 seconds before I was presented a prompt. Being in the console for the better part of the day, this was unacceptable.
The first thing I did was _upgrade_ Bash to Zsh. I'd heard great things about Zsh, so I thought I'd give it a try. Zsh is really awesome, but it did not fix the start-up delay I was experiencing previously with Bash.
Doing a little digging around I found a working solution. Apparently Apple keeps system logs in `/private/var/log/asl/*.asl`. Removing these files made my shell fast again.
<p class="important">Do <strong>not</strong> remove all files in <code>/private/var/log/asl</code> as there are other files there that are not related to the shell. Leave them in there.</p>
With the above warning in the back of your mind, open your terminal (slowly) and issue the following command:
``` shell
sudo rm /private/var/log/asl/*.asl
```
Now quit and restart Terminal or iTerm2 and your prompt should present itself quickly again.