View the Most Wanted LQ Wiki articles.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 07-15-2005, 09:06 PM   #1
LQ Newbie
Registered: Jul 2005
Posts: 1

Rep: Reputation: 0
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?

Old 07-15-2005, 10:53 PM   #2
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
This should get you what you're looking for.

find . -type d
Old 07-16-2005, 01:17 AM   #3
Registered: Jun 2003
Location: Texas
Distribution: Slackware, NetBSD
Posts: 151

Rep: Reputation: 23
The command I use is tree.
You can read about it here:

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.

Last edited by nick_th_fury; 07-16-2005 at 01:19 AM.
Old 07-16-2005, 04:57 AM   #4
Registered: Jul 2004
Location: Pakistan
Distribution: Slackware 10.0, SUSE 9.1, RH 7, 7.3, 8, 9, FC2
Posts: 413

Rep: Reputation: 32
ls -R


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using chmod to recursively change directories / files [GOD]Anck Linux - Software 6 11-10-2008 07:16 PM
Remove directories recursively with same name cboyd Linux - Newbie 5 01-14-2007 10:48 PM
List all files and recursively open directories. unreal128 Linux - General 2 07-16-2005 03:06 PM
tar, excluding directories recursively towlie Linux - Newbie 3 06-17-2004 01:32 PM
recursively listing directories full paths kubicon Linux - Newbie 2 02-22-2004 04:55 PM

All times are GMT -5. The time now is 11:05 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration