Listing only directories in UNIX Listing only directories in UNIX unix unix

Listing only directories in UNIX


Try this ls -d */ to list directories within the current directory


Try this:

find . -maxdepth 1 -type d


The following

find * -maxdepth 0 -type d

basically filters the expansion of '*', i.e. all entries in the current dir, by the -type d condition.

Advantage is that, output is same as ls -1 *, but only with directories and entries do not start with a dot