compgen
Bash built-in command for generating possible completion matches in Bash. tldr-pages
On several platforms
Several platforms
Bash built-in command for generating possible completion matches in Bash. Usually used within custom completion functions.
List all shell built-ins, aliases, functions, and executables that you could run
compgen -cIdentifyList all commands that you could run that start with a specified string and save results to $COMPREPLY
compgen -V COMPREPLY -c strIdentifyMatch against a wordlist
compgen -W "apple orange banana" aIdentifyList all aliases
compgen -aIdentifyList all functions that you could run
compgen -A functionIdentifyShow shell reserved keywords
compgen -kIdentifySee all available commands/aliases starting with ls
compgen -ac lsIdentifyList all users on the system
compgen -uIdentify