list commands in shell

C++
compgen -c	#In Unix
help | more	#In Windows
Source

Also in C++: