LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 06-25-2008, 12:16 PM   #1
oskar
Senior Member
 
Registered: Feb 2006
Location: Austria
Distribution: Ubuntu 12.10
Posts: 1,138

Rep: Reputation: 49
how do I make a sensible list from a directory structure?


I wanted to make a list of all my movies for someone.
I tried:
find /movie_folder * > movies.txt

but the output doesn't make much sense. I have them organized in folders. Find will show one folder, then go to the next one half way through, and then come back and continue.


Is there a way I could get a list like:

root_directory
root_directory/subdirectory 1
root_directory/subdirectory 1/file
root_directory/subdirectory 1/file
root_directory/subdirectory 1/file
root_directory/subdirectory 1/file
root_directory/subdirectory 2
root_directory/subdirectory 2/file
root_directory/subdirectory 2/file
root_directory/subdirectory 2/file
root_directory/subdirectory 2/file

Without it jumping back and forth in the directory structure.

Last edited by oskar; 06-25-2008 at 12:21 PM.
 
Old 06-25-2008, 12:21 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,745

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
Code:
ls -R /path/to/root_directory | tee movies_list
would give you such a listing.
 
Old 06-25-2008, 12:27 PM   #3
oskar
Senior Member
 
Registered: Feb 2006
Location: Austria
Distribution: Ubuntu 12.10
Posts: 1,138

Original Poster
Rep: Reputation: 49
Thanks!
That will work.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linked list data structure in PHP? ivanatora Programming 6 08-24-2007 07:09 PM
Directory Structure fedix Linux - Newbie 3 10-14-2005 02:48 PM
"WARNING: Circular directory structure" error when deleting directory pistonbrew Linux - Software 5 02-03-2005 06:05 AM
Undefined reference Error in list data structure ashwinipahuja Programming 1 04-29-2004 05:11 PM
directory structure alaios Linux From Scratch 4 04-20-2004 06:16 PM


All times are GMT -5. The time now is 03:25 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration