Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want add autocompletion to my script. I wrote bash code for autocomplete (using this tutor and put it to /etc/bash_completion.d/ then i execute in bash complete -F _main_complete -o filenames ./ and it's works.

But after reboot I need write this command again.

Sure I can add this to .bashrc, but it looks bad. Where config file for complete located?

share|improve this question
I can use me bash file for complete options – Stepan Loginov Feb 11 '14 at 17:55
up vote 0 down vote accepted

It appears that, for a login shell,

  1. /etc/profile will source
  2. /etc/profile.d/, which will source
  3. /usr/share/bash-completion/bash_completion, which will source
  4. ~/.bash_completion

assuming all those files exist and are readable.

Put your own completions in ~/.bash_completion

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.