> For the complete documentation index, see [llms.txt](https://knowledge.tracelog.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledge.tracelog.in/linux-and-core/linux/bash-completion-on-debian-9.md).

# Bash completion on Linux/Mac

### 1. Debian 9

By default, `debian 9 stretch` does not have completion as `ubuntu` distro, we will need it in some specific cases and can speed up daily operation tasks

* Autocomplete / hint when pressing tab
* Apply for all user/profile

```
apt install bash-completion

# In file /etc/profile
if [ -f /etc/bash_completion ]; then
 . /etc/bash_completion
fi
```

### 2. Mac (with wireguard vpn)&#x20;

```
bash --version
GNU bash, version 5.0.7(1)-release (x86_64-apple-darwin18.5.0)

brew install bash-completion
brew reinstall bash-completion

# In file ~/.bash_profile

[[ ${BASH_VERSINFO[0]} -ge 4 ]] || return 0
if [ -f $(brew --prefix)/etc/bash_completion ]; then
    . $(brew --prefix)/etc/bash_completion
fi
```

### Reference

1. <https://lists.zx2c4.com/pipermail/wireguard/2018-October/003418.html>
2. <https://github.com/Homebrew/homebrew-core/issues/32535>
