List All Commands in Bash

List All Commands in Bash

Sometimes, we wish to see all commands in Bash. There are many tricks to do that, but they are rather complicated. However, we can do that in a simple way. We can use compgen that is a command for generating possible completion matches for word. But we can use it to list all commands in Bash. Let’s do that:

linux-7tpy:/home/poganin # compgen -abc -A function

But there are a lot of commands, so better use this way:

linux-7tpy:/home/poganin # compgen -abc -A function | less

Thousands commands to use in Bash. 8319 in my operating system. Let’s look at the options:

-a – aliases

-b – builtins

-c – commands

-A function – shell functions

So you don have to list all of them. For example, you can see all aliases by running:

linux-7tpy:/home/poganin # compgen -abc -A function | grep wcwcb43-fwcuttershowcharwcgrepshowconsolefonthwclockshowconsolepwconvhwclockiwconfigpwckshowconsolefontwcb43-fwcuttershowcharwcgrepshowconsolefont
We have got all commands that can be associated with our wc.