Recommended course:

Mac OS X Superuser - Use Mac OS X like a Pro

macOS by default does not have Bash autocomplete feature at the terminal by default as Linux distributions like Ubuntu does. To enable it, you will have to install and enable bash-completion program for macOS which is available via Homebrew.

Follow these steps at the Terminal to have autocomplete feature in Bash for your macOS:

  1. Install Homebrew by running the following commands.
    $ /usr/bin/ruby -e "$(curl -fsSL"
  2. Install bash-completion via Homebrew.
    $ brew install bash-completion
  3. Manually enable bash-completion for current session.
    $ . /usr/local/etc/bash_completion
  4. Automatically enable bash-completion when launching a new shell session by adding the following lines to ~/.bashrc or ~/.bash_profile.
    [ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion