LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 08-30-2004, 05:18 PM   #1
jeep99899
LQ Newbie
 
Registered: Aug 2004
Posts: 11

Rep: Reputation: 0
Is this possible to do


I have directory that has several sub directories which contain files. Is there a way to print a list of the directories and the content of the sub directories in say a txt file so that i can evaluate the listing of files contained in the directories?
 
Old 08-30-2004, 05:21 PM   #2
mugstar
Member
 
Registered: Jun 2004
Location: Scotland
Distribution: Anything that'll install...
Posts: 305

Rep: Reputation: 30
`ls -R /name/of/directory > name-of-list-file.txt`
 
Old 08-30-2004, 05:21 PM   #3
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Welcome to LQ.

You can use:
ls -laR /path/to/directory > /path/to/log.file
 
Old 08-30-2004, 05:24 PM   #4
mugstar
Member
 
Registered: Jun 2004
Location: Scotland
Distribution: Anything that'll install...
Posts: 305

Rep: Reputation: 30
Argh! I forgot that I have aliased `ls` to `ls -lh`...

Use -l for long file listing, -a to include hidden files.

Do `man ls` for full details.
 
  


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




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

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration