> 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>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://knowledge.tracelog.in/linux-and-core/linux/bash-completion-on-debian-9.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
