Contents
What is compgen command?
compgen is a bash built-in command which is used to list all the commands that could be executed in the Linux system. This command could also be used to count the total number of commands present in the terminal or even to look for a command with the specific keyword.
What does bash complete do?
Bash completion is a bash function that allows you to auto complete commands or arguments by typing partially commands or arguments, then pressing the [Tab] key. This will help you when writing the bash command in terminal.
What is a completion file?
Filename completion is a feature built into some Unix shells that allows you to type part of a filename or directory name and press a key to fill out the rest. In most shells, you can type only enough of the file’s name to make it unique, and then press the Esc key to fill in the rest.
Where can I find the documentation for COMPGEN in Bash?
A leading ‘!’ in filterpat negates the pattern; in this case, any completion not matching filterpat is removed. A rather exhaustive looking version of the documentation can be found in Programmable Completion Builtins. As both commands are built in command, the official documentation is on your local man page for bash.
What do you use COMPGEN for in Linux?
compgen is a bash built-in command which is used to list all the commands that could be executed in the Linux system. This command could also be used to count the total number of commands present in the terminal or even to look for a command with the specific keyword.
What does the comp option do in Bash?
The comp-option controls several aspects of the compspec’s behavior beyond the simple generation of completions. comp-option may be one of: Perform the rest of the default Bash completions if the compspec generates no matches. Use Readline’s default filename completion if the compspec generates no matches.
How to generate list of possible completions in Bash?
The action may be one of the following to generate a list of possible completions: Alias names. May also be specified as -a . Array variable names. Readline key binding names (see Bindable Readline Commands ). Names of shell builtin commands. May also be specified as -b . Command names. May also be specified as -c . Directory names.