UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 19th, 2005, 09:27 PM
ramped ramped is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 3 ramped User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 44 m 42 sec
Reputation Power: 0
Easy way for a recursive directory listing

I need to get a recursive directory listing with the output going to a file of all the files in a web server's directory in the form:

/path/to/file/file1.html
/path/to/file/file2.gif

i.e. one file to a line with the full path. The easiest way I can think of is
Code:
find . > output
but as this is a production server, I want something that won't hit IO too hard (CPU shouldn't be a problem as the command will be run from a different server, just searching a file system on production machines). It is load balanced over two servers which I don't have direct access to, so I can't use top to watch them and kill the process if need be, so I want to make sure that I am doing it the most efficiant way before starting. Any ideas?

Reply With Quote
  #2  
Old June 23rd, 2005, 09:37 AM
jim mcnamara jim mcnamara is offline
......@.........
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Posts: 1,308 jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 5 h 20 m 49 sec
Reputation Power: 48
find and ls both call opendir(), scandir(), readdir(). Those are about the only choices.

You can nice the process, but you already said there isn't much CPU contention.

Reply With Quote
  #3  
Old July 13th, 2005, 04:47 AM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,098 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 9 h 5 m 46 sec
Reputation Power: 9
you really need to know what you want
scan or not scan
find is the way
ls make (internal) a sort, so a (very) slower way
__________________
working on Solaris[5-9], preferred languages french and C.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Easy way for a recursive directory listing


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT