List all available Linux commands

To list all available Linux commands:
bash -norc
Press Tab twice.
It'll ask you if you want to show all available commands. Press 'y'.

It'll show you a two-column list, with spaces between the two columns.

You'll have to scroll through the {More...} to get to the bottom of the list.

Then you can copy-n-paste the two columns into the text editor, do a search-n-replace for double-spaces, replace the double-spaces with Tab and keep doing that until there are no double-spaces.

Then do a search for a single space and replace them with nothing.

Then do a search for double-tab and replace them with a single tab and repeat that until only a single Tab remains between the two columns.

Then you can copy-n-paste the whole thing into OpenOffice Calc, with Tab as the delimiter, then copy-n-paste the second column below the end of the first column to get one long list.

Then you can copy-n-paste that back into the text editor and save it as a file... one long, single-column list of all Linux commands.

1 Like

Cool trick, and to supplement that you can use this website to give you information about those commands before installing them: https://manpages.org/

Many man pages are available from the terminal as well. Example: man dpkg

When I was doing Python programming, my editor would pop up a description of the commands as I typed, along with expected flags / variables / etc... that would be a very handy feature in Terminal.

May be it can be done with "Oh my ZSH"?

I know with vim/neovim this can be done, but straight into the command line I don't know. Even these tools need several plugins, like a snippet engine and language servers, to get things working.