Get a list of all available Linux commands that you can use

We're all familiar with Linux's command-line interface (CLI), which allows you to execute nearly any job you can think of by just typing commands into it. This is why we have such a lengthy list of commands for the various versions of Linux. We'll go through the various techniques for showing all of the commands, functions, aliases, and keywords that your Linux terminal may run in today's article.

Listing all the Commands, Functions, Aliases, and Keywords that your Linux console can run

There are different ways of listing down the commands, functions, aliases, and keywords that your terminal can run, and these methods are discussed below:

Note: The command used in all of the methods discussed in this article i.e. “compgen” is a built-in Linux command.

Listing down all the commands that your Terminal can run

If you want to list down all the possible commands that your terminal is capable of running regardless of whether they are built-in or non-built-in, you will have to type the following command and then hit the Enter key:

$ compgen -c

Linux compgen command

All the possible commands that our Linux terminal can run are shown in the image below. You can just scroll up or down to view the entire list.

Result of the compgen command

Listing down all the Built-in Commands that your Terminal can run

Now, if you only want to list down those commands that are installed by default, or in other words, the commands that are built-in that your terminal can run, then you will have to execute the following command:

$ compgen -b

List builtin commands

All the built-in commands that our Linux terminal can execute are shown in the image below. You can just scroll up or down to view the entire list.

List of builtin commands

Listing down all the Keywords that your Terminal can run:

You can even list down all the keywords that your terminal can run by typing the following command and hitting the Enter key:

$ compgen -k

shell keyword list

All the keywords that our Linux terminal can run are shown in the form of a list in the image below:

Keywords built into the current shell

Listing down all the Aliases that your Terminal can run:

To list down all the aliases that your terminal is capable of running, you will have to execute the following command:

$ compgen -a

List of aliases

All the aliases that our Linux Mint 20 terminal can run are shown in the form of a list in the image below:

List of Aliases

Listing down all the Functions that your Terminal can run:

You can even list down all the functions that your terminal can run by executing the following command in your terminal:

$ compgen -A function

List of terminal functions

All the functions that our Linux terminal can run are shown in the image below. You can just scroll up or down to view the entire list.

Function list

Listing down the Commands, Keywords, Aliases, and Functions altogether that your Terminal can run

Finally, if you want to achieve the integrated output of all the commands that we have executed so far in this article, then you will have to use the following variation of the “compgen” command:

$ compgen -A function -abck

Commands, Keywords, Aliases, and Functions in one list

Executing the above-mentioned command will display all the commands, keywords, aliases, and functions that our Linux shell is capable of running. You can just scroll up or down to view the entire list.

List of shell Commands, Keywords, Aliases, and Functions

Conclusion

This article went through the various techniques for showing the commands, functions, keywords, and aliases that your Linux terminal may perform in detail. Following any of these techniques, depending on your needs, will provide you with quick access to all of the activities that you may perform on an Ubuntu system using the various commands, functions, aliases, and keywords.

Leave a Comment