Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-28-2006, 04:59 PM   #1
Registered: May 2005
Location: Canada
Distribution: PCLinuxOS 2007
Posts: 274

Rep: Reputation: 30
ls content of a folder

I want to create a txt with my folder content using this command

ls music > mp3list.txt

but it only sorts the song in that folder, it doesnt list the songs inside the folders inside /music... ie. /music/rock will not be sorted..... how do you do that??
Old 09-28-2006, 05:14 PM   #2
Senior Member
Registered: Jun 2004
Location: Chicago
Distribution: Slackware64 -current
Posts: 1,158

Rep: Reputation: 61
Originally Posted by lonecrow
ls music > mp3list.txt
ls -R music > mp3list.txt
will work.

man ls is your friend.

Old 09-28-2006, 07:12 PM   #3
Registered: May 2005
Location: Canada
Distribution: PCLinuxOS 2007
Posts: 274

Original Poster
Rep: Reputation: 30
thanks man, sorry for the stupid question... I tried with -r but -R did the trick!

should have looked at the man pages first... sry!


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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
copy content of the folder ashley75 Linux - General 6 04-16-2007 11:50 AM
Deleting folder content Azhrarn Linux - Software 4 04-27-2006 05:07 AM
reading contents of a folder and moving that content mrobertson Programming 0 02-17-2006 09:14 AM
how can i default the max folder file size when it create inside a folder antony_csf Linux - Software 1 06-17-2004 03:26 AM
Apache serving content after the content is removed? jrbush82 Linux - Software 6 05-05-2004 05:39 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:39 PM.

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