LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-04-2003, 11:18 PM   #1
CowboyJ
LQ Newbie
 
Registered: Nov 2003
Location: Ohio
Distribution: SUSE 9.0
Posts: 13

Rep: Reputation: 0
list sub-directories only


I would like to get a listing of all sub-directories for a given directory, without including files. I have tried "ls -RN <directory name>", but for some reason, I still get all filenames included.
 
Old 12-04-2003, 11:42 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Find is the tool to use:

$ find . -type d -print

-type d => list dirs only

See man find for more options.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] command to list directories only frieza Linux - Software 16 04-01-2016 11:53 AM
Can ls recursively list only directories? Vosper Linux - General 3 07-16-2005 03:57 AM
proftpd directories list bacon22 Linux - Networking 2 01-21-2004 09:49 AM
Asking LS for a list of directories only gary knott Linux - Newbie 1 11-12-2003 05:49 PM
list of directories greg108 Linux - Newbie 5 08-08-2003 03:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration