Sunday, May 19, 2024
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 12440  / 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
ticrew questions
Mon, Jan 10, 22, 07:20, 2 Years ago
Wed, Dec 8, 21, 19:25, 3 Years ago
Wed, May 5, 21, 08:17, 3 Years ago
Fri, Mar 10, 23, 17:21, 1 Year ago
Fri, Nov 4, 22, 06:43, 2 Years ago
;