why `ls -d .` does not list all dirs, as `ls -d */` does? [duplicate]
The -d
option lists directories themselves, not their content. If you issue the command ls -d .
then it will list the argument, i.e. .
, a.k.a. the current directory by its own, rather than listing the contents of the argument, i.e., the files in the current directory.
.
represents the current directory. */
matches all directories existing in the current directory.
Try ls -dl .
for a more interesting variation of the ls -d .
command.