Exists any kind of alternative with 'ls' command that I see just the directory sites?

Occasionally, I require to examine just the directory sites not documents. Exists any kind of alternative with the command ls? Or exists any kind of energy for doing that?

MODIFY: I'm making use of Mac OS X, and also ls -d offers me . despite the fact that I have directory sites.

0
2019-05-04 08:48:01
Source Share
Answers: 4

No, yet a straightforward find command will certainly do it :

find . -type d -depth 1

or grep

ls -F | grep /

You can after that alias either one if essential.

0
2019-05-08 03:16:48
Source

I assume ls has a bug on Mac OS X. A workaround is to make use of grep ... ls -l / | grep "^d"

0
2019-05-08 03:10:05
Source

I such as the tree energy to get a review over the directory site framework. It's readily available in MacPorts and also all Linux circulations I've attempted.

tree -d -L 2

That would certainly show all directory sites, 2 degrees deep.

0
2019-05-08 02:53:55
Source

I recognize there is currently a picked solution, yet you can get the asked for actions with simply ls :

ls -ld -- */
.

(Keep in mind that the '--' notes completion of parameters, protecting against folder names starting with a hyphen from being taken more command alternatives. )

This will certainly detail all the non-hidden (unless you configure your covering's chunks to expand them ) directory sites in the existing functioning directory site where it is run (note that it additionally consists of symbolic web links to directory sites ). To get all the subdirectories of a few other folder, simply attempt :

ls -ld /path/to/directory/*/
.

Keep in mind that the -l is optional.

0
2019-05-07 22:26:13
Source