Adding the -d flag simply instructs ls simply list the directory entries, not their contents. * assigned by ls extends to all entries in the current directory, both files and dirs. Thus, ls -d * will list all entries in this directory without expanding the subdirectories. But if you use */ , then bash extends it to include only directories in this directory. But with just ls */ all directories will be expanded. Adding the -d flag prevents this, and you only get directories in this directory.
source share