Wednesday, May 8, 2024
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 12435  / 2 Years ago, sun, december 26, 2021, 11:25:43

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!


More From » command-line

 Answers
1

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



find /some/folder -printf '"%P";"%Tc";"%s";
' > listing.csv


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.


[#30630] Tuesday, December 28, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ticrew

Total Points: 190
Total Questions: 111
Total Answers: 99

Location: Fiji
Member since Wed, Jul 14, 2021
3 Years ago
;