Like fd0 commented above, the best source for quickly listing most everything you can do in the Terminal, is by using the Bash builtin compgen.
Compgen
interfaces with the "completion" function in Bash, so it is intended to keep a list of most everything you can do in the shell. So it is interesting that technically compgen is listing commands, aliases, and functions, as well as a few other things like builtins, variables, groups, jobs and service names. My experience is that it will not list everthing, like applications typcially ran in the GUI, which I will mention below. You can use the open
command in OSX for quite a few things, for example.
compgen -c
executes the command in a subshell environment, and its output is used as the possible completions, which is probably what you want. If Bash if your shell, it will spew out similar information for all commands or a single command if you press Tab Tab.
It's also common in OSX that many programs can be executed from the shell, so many program names that you'll find in /Applications can also be called via a CLI from the shell. Similarly, many programs are (at least) at /Applications/Utilities, some interesting stuff is at /System/Library/CoreServices/Applications (as well as other things under the /System main directory...), and as well sometimes custom programs get put under the classic Unix locations like /usr/bin, usr/local/bin, /opt, and /sys/bin.
Often you can find other interesting things to type, probably also covered above, by typing help
or help [command or argument]
, with more information about most programs or builtins coming with info [command]
or man [command].
Apropos
is also quite interesting, which you may know already. These things will get most everything, I imagine there are other things one just needs, or should, hack around and discover...
compgen -c
will work.zsh: command not found: compgen
bash
thencompgen -c
it works, I guess my question should have been what it the zsh equivalent to the bash commandcompgen -c