The UNIX and Linux Forums  

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 !!

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

Join Date: Apr 2008
Posts: 9
Stumble this Post!
Almost impossible question

Would anyone know how to get a directory listing of all files in a directory as well as all the files in their respective subdirectories and save the listings to a file? I realize this is tricky.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-23-2008
Registered User
 

Join Date: Oct 2007
Location: USA
Posts: 541
Stumble this Post!
Use the find command.
Reply With Quote
  #3 (permalink)  
Old 04-23-2008
Registered User
 

Join Date: Apr 2008
Posts: 9
Stumble this Post!
Quote:
Originally Posted by shamrock View Post
Use the find command.
..lol..can anyone at all help me?
Reply With Quote
  #4 (permalink)  
Old 04-23-2008
era era is online now
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,630
Stumble this Post!
The forums are shock full of examples. I would estimate that there would be a dozen good hints if you were to take the time search just the last few days' worth of postings.

Code:
find . -ls > outputfile
... provided your find understands -ls
Reply With Quote
  #5 (permalink)  
Old 04-23-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,812
Stumble this Post!
Code:
find /path/to/starting/directory -exec ls {} \;
will work on any modern unix system
Reply With Quote
  #6 (permalink)  
Old 04-23-2008
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,002
Stumble this Post!
Quote:
Originally Posted by jim mcnamara View Post
Code:
find /path/to/starting/directory -exec ls {} \;
will work on any modern unix system
find /path/to/starting/directory -type f > outputfile
Reply With Quote
  #7 (permalink)  
Old 04-24-2008
Registered User
 

Join Date: Apr 2008
Posts: 9
Stumble this Post!
My version of UNIX isn't modern....I get the following error:

UX:find: ERROR: No action specified
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:31 AM.


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

Content Relevant URLs by vBSEO 3.2.0