![Forrest logo](/images/logo.png)
compgen:tldr:8578a
compgen: List all commands that you could run.
$ compgen -c
try on your machine
The command compgen -c
is used in Linux and UNIX-like operating systems to generate a list of all available commands.
When you execute the command compgen -c
, it will display a list of all the commands that can be executed directly in the current environment.
This command is useful if you want to see all the available commands without having to manually search through directories or consult external documentation. It can help you discover new commands or verify if a specific command is installed on your system.
The compgen
command is commonly used in combination with other commands and shell functionalities, such as piping the output of compgen -c
to another command for further processing or filtering.
This explanation was created by an AI. In most cases those are correct. But please always be careful and
never run a command you are not sure if it is safe.