According to bash man page:
bash scans each word for the
characters *, ?, and [. If one of
these characters appears, then the
word is regarded as a pattern, and
replaced with an alphabetically sorted
list of file names matching the
and from info node for ls
The `ls' program lists information
about files (of any type, including
directories). Options and file
arguments can be intermixed
arbitrarily, as usual.
For non-option command-line
arguments that are directories, by
default 'ls' lists the contents of
directories, not recursively, and
omitting files with names beginning
with '.'. For other non-option
arguments, by default `ls' lists just
the file name. If no non-option
arguments are specified, 'ls' lists
the contents of the current directory.
so when yo give
ls d*, d* is expanded to sorted list of all file/directory names starting with d. So you command becomes
and as dump is a directory name so you get the listing of all files in the directory "dump'
but when you give
ls D*, D* is expanded to "Desktop Documents Downloads Dropbox", so the command becomes
ls Desktop Documents Downloads Dropbox
and as all of these are directories, you get the listing of files in individual directory. If there was a file starting with D in current directory it would have been listed seperately.