Using the Linux compgen bash builtin

The content below is taken from the original ( Using the Linux compgen bash builtin), to continue reading please visit the site. Remember to respect the Author & Copyright.

Linux’s compgen command is not actually a Linux command. In other words, it’s not implemented as an executable file, but is instead a bash builtin. That means that it’s part of the bash executable. So, if you were to type “which compgen”, your shell would run through all of the locations included in your $PATH variable, but it just wouldn’t find it.

$ which compgen
/usr/bin/which: no compgen in (.:/home/shs/.local/bin:/home/shs/bin:/usr/local/bin:

Obviously, the which command had no luck in finding it.

If, on the other hand, you type “man compgen”, you’ll end up looking at the man page for the bash shell. From that man page, you can scroll down to this explanation if you’re patient enough to look for it.

To read this article in full, please click here