How do I speed up my Mac OS Shell

My dear friend, if you’d rather using terminal instead of gui for your preferred apps in the day by day, boy, I’m afraid you’re a geek that you like see only text and numbers, because you do not have a girlfriend. Do not worry, it is not end of the world.

But what the heck the Terminal is? or what does the Terminal app for? To use the mac os terminal, it turns efficient and fast because you can access to the apps installed on the system through an interface where you can see things that normally might not seen in a graphical interface.

Nonetheless, sometimes could it be slow over time and it gets annoying when it takes so long to starts up, most of cases it took about 10~20 seconds in order to show a prompt, if you feel this is happening to you, you can do a trick to fix that, but we must know that the Mac OS Terminal works under a shell which is bash by default and it could be optimized its speed changing some stuff in the .bash_profile file, adding some alias or modifying the prompt, it is some of things that you can do to lighten up the problem tho.

For example, you could begin by changing shell interpreter in Terminal’s preferences like this:

and maybe, setting up basic colours in the Profile tab.

It’d rather being changed to zsh interpreter because this one is able to manage loads average better, but it is suitable for advanced users since you need to do some tricks to optimize it, thus, in order to optimize bash interpreter, the easy way is removing log files created by Apple, so you can get smooth launch times of the terminal dramatically from about 3~5 seconds personally.

At the command line, just type the following:

$ cd /private/var/log/asl/

Now, you’re able to remove whole bunch of files with asl extension:

$ sudo rm *.asl

You also try this command in shorthand:

$ sudo rm -rf /private/var/log/asl/*.asl

and effectively all asl files were removed, but you need to be cautious that only these files will be removed because inside of asl folder there are important files that terminal needs.

But that is not all folks, now we have a look how do we can optimize the speed of the terminal using zsh interpreter.
One of the things you have to consider, zsh manage plugins in order to make work easier around of tools like git, svn, brew, etcetera… ok well, this tool comes with huge resources of your computer taken, when you load as much plugin as you wish probably your mac’s speed will compromise. therefore, to increase speed you can remove any plugin that oh-my-zsh has defined in the plugins variable in the .zshrc file, modify it, save it, and no need to reboot anything, only you have to do is the following command:

$ source .zshrc

Some people will tell you that there are many better reasons why zsh gets slow, but I can tell you that implies changing whole library to manage zsh, for example, prezto is another good option if you keep using zsh, this last one as know as fish-ssh before.

Leave a Reply