In the world of command-line interfaces, auto-completion can be a boon for productivity. Bash completion is a functionality provided by the bash shell, which offers context-aware auto-completion of commands and their arguments.
For developers and system administrators who frequently utilize the command line on macOS, bash completion is a feature that can save a significant amount of time. Older macOS versions come with bash as the default shell, but unlike Linux distributions, bash completion isn't enabled out-of-the-box.
However, with a little configuration and the assistance of the package manager Homebrew, you can effortlessly enable bash completion and make your command line experience smoother on your macOS system.
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew install bash-completion
$ . /usr/local/etc/bash_completion
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion
Comment anonymously. Login not required.