Hello Everyone, in this post we will see how to list all available commands inside linux.
When we deal with command line, it really becomes difficult to remember each & every command, In order to come out of it we can use a single command ‘compgen‘ to search all relative commands in linux. Let’s see how it works.
Just open the terminal and enter below command, it will display all linux commands that you can use
root@ubuntu:~# compgen -c
It will display a huge list of commands like shown below:-
............. .............. busybox plymouth-upstart-bridge ed login pwd nano plymouth df sed ntfstruncate setfont ps zdiff bzless ............. ..............
You can use this command with other options in order to customize the search like as shown below:-
Here in above picture we have searched all commands that contains keyword time & cd. Similarly you can use it as per your requirement.
In order to count the total no. you can use below command
root@ubuntu:~# compgen -c | wc -l 1953
It will display a count of commands you can execute.