For example, if you are in home directory and type ls *, you will have all the directories listed, and below the name of the listed directory, the files that it contains. On the other hand, if you type echo * the command will list just the directories, and not the directories and content that they have. Why is that?
1 Answer
In both cases the * gets expanded by the shell.
echo than just prints the parameters resulting from the expansion.
ls checks for every parameter if it is a directory and lists its contents if it is one.