The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages here.

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

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-05-2008
niceboykunal123 niceboykunal123 is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 31
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
  #2 (permalink)  
Old 05-05-2008
sank sank is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 24
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 ^./
  #3 (permalink)  
Old 05-05-2008
niceboykunal123 niceboykunal123 is offline
Registered User
  
 

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

it worked as per my requirements...!!!
  #4 (permalink)  
Old 05-05-2008
krishmaths krishmaths is offline
Registered User
  
 

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

Code:
find . -type d
  #5 (permalink)  
Old 05-06-2008
learnbash learnbash is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 96
Wink

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

Code:
find . -type d

find . -type d | grep ^./

this way not give "."
  #6 (permalink)  
Old 05-06-2008
namishtiwari namishtiwari is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2007
Location: Bangalore
Posts: 377
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 \/$
  #7 (permalink)  
Old 05-06-2008
niceboykunal123 niceboykunal123 is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 31
Thanks all these options all working....!!!
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:08 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0