I was wondering if there is simple way to list tab completions in a file that will be accessed by all commands (e.g. are independent of the command currently on the terminal), if no other completions are found?

For example:

in magic_completion_file.txt:


(There would potentially many thousands of such completions)

Now when typing:

cat [TAB] #displays comp1,comp2,comp3

  • Completions are command specific. On Debian/Ubuntu you could have a look at the directory /usr/share/bash-completion/completions. There are central function, that you could replace, like _filedir. Have a look at /etc/bash_completion or maybe /usr/share/bash-completion/bash_completion. BTW: I wouldn't touch that. – Ralf Jan 21 at 19:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.