Forrest logo
back to the compgen tool

compgen:tldr:63f37

compgen: Show shell reserved keywords.
$ compgen -k
try on your machine

The compgen -k command is used in Unix/Linux shell environments to list all available keywords (commands) in the current bash session.

Here's a breakdown of the command parts:

  • compgen is a command that generates a list of completions for a specified context.
  • -k is an option/flag provided to the compgen command, specifically used to list all available keywords (commands).

When you execute compgen -k, it will display a list of all the available commands that can be used in the current bash session. This can be helpful when you want to check what commands are available for you to use without having to search through various manuals or guess them manually.

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.
back to the compgen tool