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 > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Display only subdirectories from given directories HAA Shell Programming and Scripting 8 04-25-2007 05:36 AM
export display of directories of remote machine bhakti Shell Programming and Scripting 2 07-19-2006 06:55 AM
Bash Script to display directories in Path? debut Shell Programming and Scripting 1 11-09-2005 05:06 PM
Recursively deleting directories mikeshank UNIX for Dummies Questions & Answers 4 11-26-2004 11:58 AM
how can i display the list of directories(only) indianguru UNIX for Dummies Questions & Answers 3 07-24-2001 02:02 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-21-2007
jwriter jwriter is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 2
How to display directories recursively?

Cannot find how to list the directory structure of a volume recursively. Do not want the files reported. Say I have 100 directories and 10,000 files, I do not want 10,000 lines of output. (If this is relevant, I am using the terminal on my OSX Mac). I hope this is easy - there should be an easy way. -- jim
  #2 (permalink)  
Old 04-21-2007
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,190
Code:
find <base directory> -type d
eg:

Code:
find /export -type d
  #3 (permalink)  
Old 04-21-2007
jwriter jwriter is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 2
Thank you Reborg. Since this is a dummies group, could you explain why number (1) works but numbers (2) and (3) don't work?

(1)
guests-Computer:/volumes/white guest$ pwd
/volumes/white
guests-Computer:/volumes/white guest$ find . -type d
.
./pho_pp
./pho_pp/Test_dir
./pho_pers
(snip)

(2)
guests-Computer:/volumes/white guest$ pwd
/volumes/white
guests-Computer:/volumes/white guest$ find /white -type d
find: /white: No such file or directory

(3)
guests-Computer:/volumes guest$ pwd
/volumes
guests-Computer:/volumes guest$ find /white -type d
find: /white: No such file or directory
  #4 (permalink)  
Old 04-22-2007
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
In (1), you specify that the find command is to search in the pwd. In (2) and (3), the find command is supposed to search in the /white directory which does not exist. In fact, it clearly says that in the output doesn't it.

To make (3) work, run the command as:
Code:
guests-Computer:/volumes guest$ pwd
/volumes
guests-Computer:/volumes guest$ find white -type d
Assuming that 'white' is a directory inside /volumes, the command will work.
  #5 (permalink)  
Old 04-23-2007
teambrew teambrew is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 1
One of the easy way to list just the directory is using ls -ltr|grep ^d
try that.
  #6 (permalink)  
Old 04-23-2007
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,190
Easy yes, but incredibly slow, and in most cases not very useful output for use in a script.
Sponsored Links
Closed Thread

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 07:19 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
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