How do I list all linux commands

Where do I find all linux commands available on the linux
command line. I also would like to know their, meaning, description
and usage. Currently have only access to the basic linux commands.
thank you

One way on how you can list all available commands on your Linux system is by executing the following command:

$ for i in ${PATH//:/ }; do ls $i; done | sort | uniq

However, this will produce a long list of available commands with no description. Having said that, I do not believe that is is what you ultimately want. Better way to find commands for a given purpose is by using apropos command. apropos allows you to search based on command page and description which should narrow down your search. Say, that I need a command which can be used to create directory.

First, Iā€™m going to search for directory keyword:

$ apropos directory

The above command produces a long list of commands. To be exact on my system the above command returns 77 commands. From here I have two options.

  1. Go trough all 77 commands and find the one that I need based on its description or
  2. Narrow down the search by using grep command. For example to search for more specific keyword like create:

$ apropos directory | grep create
mkdir (2) - create a directory
mkdirat (2) - create a directory
mkdtemp (3) - create a unique temporary directory
mkfontdir (1) - create an index of X font files in a directory
mklost+found (8) - create a lost+found directory on a mounted Linux second extended file system
mktemp (1) - create a temporary file or directory
pam_mkhomedir (8) - PAM module to create users home directory
update-info-dir (8) - update or create index file from all installed info files in directory
vgmknodes (8) - recreate volume group directory and logical volume special files

Now, that I have few options to choose from I can learn about each by using man command. So for example to see the description of the mkdir command I will run:

$ man mkdir

To quit man page hit q key.

Hope this helps

Lubos

1 Like