LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 07-15-2005, 08:06 PM   #1
Vosper
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?

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

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

Code:
find . -type d
 
Old 07-16-2005, 12:17 AM   #3
nick_th_fury
Member
 
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:
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.

Last edited by nick_th_fury; 07-16-2005 at 12:19 AM.
 
Old 07-16-2005, 03:57 AM   #4
ilnli
Member
 
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
or
tree
 
  


Reply


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 06:16 PM
Remove directories recursively with same name cboyd Linux - Newbie 5 01-14-2007 09:48 PM
List all files and recursively open directories. unreal128 Linux - General 2 07-16-2005 02:06 PM
tar, excluding directories recursively towlie Linux - Newbie 3 06-17-2004 12:32 PM
recursively listing directories full paths kubicon Linux - Newbie 2 02-22-2004 03:55 PM


All times are GMT -5. The time now is 10:50 PM.

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