I am looking for some command e.g. match ls which should match commands like ls, alsa asls,.. and return them. I preferably want it to cover both all commands and defined functions. Is there a builtin command/application to do this?Obviously, I can create my own script for that. But, I am asking just in case anyone knows of existing command/script that does the same?
Find commands/function whose name matches a value
bash;shell;shell script
There is a utility in bash called compgen.# List all Commandscompgen -c# List all Commands starting with lscompgen -c ls# List all Commands that has 'ls' in itcompgen -c | grep ls