The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
command to list a only sub-directories mail2sant UNIX for Dummies Questions & Answers 1 05-09-2008 07:11 AM
how to list directories only yodadbl07 UNIX for Dummies Questions & Answers 3 04-26-2006 01:48 AM
How to list only directories? videsh77 UNIX for Dummies Questions & Answers 4 01-09-2006 06:10 AM
List directories malaymaru UNIX for Dummies Questions & Answers 3 09-25-2005 06:54 AM
list only directories in commandline. jhmr7 UNIX for Dummies Questions & Answers 8 03-18-2005 10:30 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-05-2008
Registered User
 

Join Date: Apr 2008
Posts: 20
Want to Get List of All directories

Hi,

Is there any one-lier through which I will be able to reach to last directory excluding all files only directrory and sub-directoris should be displayed from the current path.

Thanks in advance
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-05-2008
Registered User
 

Join Date: Feb 2008
Posts: 19
Quote:
Originally Posted by niceboykunal123 View Post
Hi,

Is there any one-lier through which I will be able to reach to last directory excluding all files only directrory and sub-directoris should be displayed from the current path.

Thanks in advance
is this is what you are looking for ?:

ls -ltrR | grep ^./
Reply With Quote
  #3 (permalink)  
Old 05-05-2008
Registered User
 

Join Date: Apr 2008
Posts: 20
Thanks a lot...

it worked as per my requirements...!!!
Reply With Quote
  #4 (permalink)  
Old 05-05-2008
Registered User
 

Join Date: Sep 2006
Location: Mysore, India
Posts: 156
Another way..

Code:
find . -type d
Reply With Quote
  #5 (permalink)  
Old 05-06-2008
Registered User
 

Join Date: Aug 2007
Location: Bangalore
Posts: 285
Quote:
Originally Posted by niceboykunal123 View Post
Hi,

Is there any one-lier through which I will be able to reach to last directory excluding all files only directrory and sub-directoris should be displayed from the current path.

Thanks in advance
Code:
ls -lRF | grep \/$
Reply With Quote
  #6 (permalink)  
Old 05-06-2008
Registered User
 

Join Date: Apr 2008
Posts: 20
Thanks all these options all working....!!!
Reply With Quote
  #7 (permalink)  
Old 05-06-2008
Registered User
 

Join Date: Mar 2008
Posts: 78
Wink

Quote:
Originally Posted by krishmaths View Post
Another way..

Code:
find . -type d

find . -type d | grep ^./

this way not give "."
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:17 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0