bash autocompletion on the Mac

bash autocompletion on the Mac

Markus Günther 04. August 2014 Tips & Tricks

0 Comments // Reading Time: 1 min.

Most of our team works with a Linux distribution. I prefer Mac OSX to work with. In my opinion, the Mac combines usability, design and a UNIX-based operating system. Every now and then, however, I envy my colleagues for one function or another. Even if they are mostly console tools.

Of course our servers run Linux as operating system, and if I develop something on the server or "commit" I find the autocomplete function of the Bash very charming and helpful for Git.

On a Mac this function is not pre-installed and I missed it so much today or was so annoyed that this circumstance had to be removed at all costs. At first I wasn't sure if there was a solution for the Mac, but as so often in life one is only one click away from happiness.

Since others have certainly not yet installed this additional tool, I don't want to withhold it from you. Bash-complition is also available for Mac.

The installation is quite simple and is finished after three steps.

1. install Homebrew if you don't have it yet click here.
2. enter brew install bash-completion into the terminal
3. add the following lines to the .bash_profile

if [ -f `brew --prefix`/etc/bash_completion ]; then
    . `brew --prefix`/etc/bash_completion
fi

With these few steps you will have an easier life in the console in the near future.


0 Comments

No comments.
    Drop files here