Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How to Retrieve the Names of Files to a txt file??

share|improve this question
1  
Do you mean ls > files.txt ? –  sBlatt Nov 4 '10 at 12:49
    
please elaborate your q. –  aneeshep Nov 4 '10 at 12:54
add comment

1 Answer

up vote 2 down vote accepted

You can execute

ls -1 >filename

this will redirect the output in the file with the filename given.

For the content of a folder:

ls -1 foldername >filename
share|improve this answer
    
How can do the same to contents of folders? –  Vassilis Nov 4 '10 at 19:05
    
ls -R >filename –  borjacampina Nov 4 '10 at 22:53
    
And if you want to see directory structure, I like the tree command. –  Kees Cook Nov 5 '10 at 0:34
    
if you want the content of a folder add the folder name to it –  txwikinger Nov 5 '10 at 15:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.