Dave Halter Dave Halter - 4 months ago 4x
Bash Question

How do I get a list of all available shell commands

In a typical Linux shell (bash) it is possible to to hit tab twice, to get a list of all available shell commands.

Is there a command which has the same behaviour? I want to pipe it into

and search it.


You could use compgen. For example:

compgen -c

You also could grep it, like this:

compgen -c | grep top$

Source: http://www.cyberciti.biz/open-source/command-line-hacks/compgen-linux-command/