LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Can ls recursively list only directories? (http://www.linuxquestions.org/questions/linux-general-1/can-ls-recursively-list-only-directories-343603/)

Vosper 07-15-2005 08:06 PM

Can ls recursively list only directories?
 
Hi, I'm trying to figure out how to get ls to recursively list only directories. I know that -R is the recursion flag, but when I try "ls -R -d */" I only get one level below the current one, it doesn't go any further. Can anyone help me with this?

Thanks :)

crabboy 07-15-2005 09:53 PM

This should get you what you're looking for.

Code:

find . -type d

nick_th_fury 07-16-2005 12:17 AM

The command I use is tree.
You can read about it here:
http://linux.ctyme.com/man/man3582.htm

or just 'man tree'

You can also pipe it's output into an ascii file like this
tree -d > list.txt
It's great for mapping directories.

ilnli 07-16-2005 03:57 AM

ls -R
or
tree


All times are GMT -5. The time now is 11:18 AM.