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 can I catalog the contents of a filesystem to a CSV file? This is particularly useful for removable media.

I've found a couple links that point in this direction:

Thank you!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

This creates a CSV file with file name, time stamp and size for all files in /some/folder/ and its subfolders:

find /some/folder -printf '"%P";"%Tc";"%s";\n'

See the documentation for -printf in the manpage for find if you want to use other fields.

Note that it doesn't work for file names containing " characters.

share|improve this answer
    
Florian, I'm getting a > prompt when I run this command and I have to Ctrl+c to get out of it. What am I doing wrong? –  Sean Fenton Aug 23 '13 at 11:25
    
Thanks. There was a ' missing at the end. Fixed it. –  Florian Diesch Aug 23 '13 at 12:48
    
Thanks, Florian! Yet another reason to learn regexp. –  Sean Fenton Aug 28 '13 at 0:55
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.