List all available commands

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the bash category.

Last Updated: 2024-04-25

Someimtes it's helpful to see all the commands that are available or remind yourself of a command's spelling. A handy hack for doing this is as follows:

compgen -c

The compgen command is used to generate all possible completion matches. And the -c option tells it to do so for "all commands"