LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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-05-2003, 12:18 AM   #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-05-2003, 12:42 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
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 15 08-03-2013 06:20 PM
Can ls recursively list only directories? Vosper Linux - General 3 07-16-2005 04:57 AM
proftpd directories list bacon22 Linux - Networking 2 01-21-2004 10:49 AM
Asking LS for a list of directories only gary knott Linux - Newbie 1 11-12-2003 06:49 PM
list of directories greg108 Linux - Newbie 5 08-08-2003 04:11 AM


All times are GMT -5. The time now is 06:31 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration