The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

If you can read me, I'm broken!

Views: 1,541β€…    Votes:  2β€…
Tag : auto-completion  
Link: πŸ” See Original Answer on Ask Ubuntu ⧉ πŸ”—

URL: https://askubuntu.com/q/1137560
Title: How does ubuntu terminals autocomplete work?
ID: /2019/04/24/How-does-ubuntu-terminals-autocomplete-work_
Created: April 24, 2019    Edited:  May 16, 2022
Upload: April 8, 2024    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false


An almost identical question was asked in StackExchange:

How does bash tab completion work?

I have been spending a lot of time in the shell lately and I’m
wondering how the tab autocomplete works. What’s the mechanism behind
it? How does the bash know the contents of every directory?


The top voted answer:

There are two parts to the autocompletion:

You can list the existing completions defined in your current bash environment using simply complete, to have an impression on what is possible. If you have the bash-completion package installed (or however it is named on your system), completions for a lot of commands are installed, and as Wrikken said, /etc/bash_completion contains a bash script which is then often executed at shell startup to configure this. Additional custom completion scripts may be placed in /etc/bash_completion.d; those are all sourced from /etc/bash_completion.

⇧ How do I find user login history? Can't reset my JAVA_HOME to new Open JDK 11 Java installation  β‡©