Skip to main content

Fixing a slow starting Terminal or iTerm2 on Mac OS X

·171 words·1 min· ·
Bash Shell MacOSX Devops Terminal Terminal.app Iterm Iterm2 Zsh
Ariejan de Vroom
Author
Ariejan de Vroom
Jack of all Trades, Professional Software Craftsman

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.

Do not remove all files in /private/var/log/asl as there are other files there that are not related to the shell. Leave them in there.

With the above warning in the back of your mind, open your terminal (slowly) and issue the following command:

sudo rm /private/var/log/asl/*.asl

Now quit and restart Terminal or iTerm2 and your prompt should present itself quickly again.

Related

Hide 'Last login:' on bash login
·82 words·1 min
Bash MacOSX
Bash it! - Number of messages in Postfix queue
·37 words·1 min
Blog Features Linux Bash Bash IT Shell Postfix Scripting Mail Server Queue Email Messages
Installing Node.js and NPM on Ubuntu/Debian
·153 words·1 min
Linux Ubuntu Debian Nodejs Devops Node Npm