[Techtalk] Listing differences between directory trees/contents
David Sumbler
david at aeolia.co.uk
Sat Apr 16 18:52:28 UTC 2022
I have a large-ish collection of audio CDs, which I have put on to my
hard drive as .flac files.
I have also got a 125Gb SD card in my Samsung tablet, and I copied the
whole tree to the SD card. The collection takes up roughly half of the
capacity of the card.
Unfortunately, I discovered that some files are missing in the SD card
copy. Also, I noticed that a few files that are on the card have a
slightly smaller reported size than the ones on my hard drive. This
may or may not be a problem.
I want to have a listing of the 2 directory trees, including file
sizes, so that I can find the differences and correct things. (A full
'ls -R' listing is over 3000 lines - there are a lot of files!). With
suitable listings I could perhaps use 'diff' to find the errors on the
SD card, or import both listings to a spreadsheet which might be more
flexible.
For each file and directory I only need the relative path, the name
and, in the case of a file, the size. Despite a lot of internet
searching I haven't found a practical way of achieving what I want,
although it seems a pretty basic thing to want to do!
Does anyone have a script that would do it, or suggestions about how I
can get the result I want?
David
More information about the Techtalk
mailing list