Custom Tab Completion

Create custom tab completion profiles for your applications


  1. Create the .bash_completion file. touch ~/.bash_completion

  2. Create the .bash_completion.d directory. mkdir ~/.bash_completion.d

  3. Edit ~/.bash_completion and enter the text below to have it scan ~/.bash_completion.d/ for completion data. nano ~/.bash_completion

     # Add each completion script in the bash_completion.d directory
     for file in ~/.bash_completion.d/*
         if [[ ${file##*/} != @(*~|*.bak) ]]; then
             # Does not seem to be a forgotten backup file
             if [ \( -f $file -o -h $file \) -a -r $file ]; then
                 # The file is a regular file or a symbolic link, and is
                 # readable by this script (for the user running the script).
                 # That is good enough for us - source the file
                 . $file
  4. Save the file with Ctrl+x followed by y and Enter when prompted to overwrite the existing file.

  5. Put your tab completion data in ~/.bash_completion.d/<App>
    For example: ~/.bash_completion.d/rclone

  6. Restart your shell or source ~/.bash_completion for the new tab completion data to take effect. source ~/.bash_completion



rclone offers a tool for creating tab completion data


Create the tab completion data into your ~/.bash_completion.d/ directory

    rclone genautocomplete bash ~/.bash_completion.d/rclone