Listing Directories in Linux
The magical incantation in linux for listing the directories in the current directory seems to be this:
$ ls -d */
The -d switch supposedly lists "directory entries instead of contents," but I don't understand why this command only returns a dot representing the current directory:
$ ls -d
I also don't understand why this command includes file names & directory names in the output:
$ ls -d *
I would have thought that all 3 commands would return the same list of directory names only.
This compound command also lists directory names only:
$ ls -l | grep '^d'











