Knowledge base
  • Goal of knowledge base
  • Linux & core
    • Linux
      • Record SSH session for reporting
      • Compress / Decompress files
      • Colorize logs
      • Cron output & logging
      • Signal
      • Break out and escape SSH session
      • Mount volume permanently
      • Show processes most consuming CPU & MEM
      • Improve and optimize battery life on Linux
      • File ownership & groups in linux
      • Automatic security update/patch on Ubuntu
      • Clean buffers and cached on linux
      • Bash completion on Linux/Mac
    • Core services
      • Nginx reload
      • OpenVPN Split tunneling
      • Nmap commands
    • Hardware
      • CPU Architecture fundamental
  • Database
    • MySQL
      • InnoDB - innodb_file_per_table parameter
      • MySQL - enable slow query log
      • MySQL - export large tables
    • MongoDB
  • Container
    • Docker
      • ADD or COPY in Dockerfile
        • Clean data of docker completely
    • Podman
  • Automation
    • Ansible
      • Output format
  • Build & Deployment
    • Jenkins
      • Jenkins - force exit pipeline when failure
  • Language & Toolset
    • PHP
      • Composer
      • php-redis & php-igbinary
  • Mindset
    • Technical based
      • Writing well
      • Reinvent The Wheel
      • Approach a new system
      • Backup philosophy
      • Mindset for building HA and scalable system
      • GitLab database incident
    • Non-technical based
      • How to read news efficiency?
      • How long should you nap?
      • Assume good faith
  • Reference & learning source
    • Books
      • Sysadmin/SRE
      • Mindsets
      • Software fundamentals
    • English
Powered by GitBook
On this page
  • 1. Debian 9
  • 2. Mac (with wireguard vpn)
  • Reference
  1. Linux & core
  2. Linux

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)

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

PreviousClean buffers and cached on linuxNextCore services

Last updated 5 years ago

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