I need your help guys! I'll try to be as specific as possible.
Scenario: I have a MOUNTED image on a Linux Distro. I copied all the files in this mounted Distro to a folder I have on my Linux System called "raw" (in a sub directory of Files...so Files/Raw). I created a HASH LIST (MD5 using md5sum) in a text file of all the files in this Raw folder. I deduped (got rid of redundant hashes) this HASH LIST into a new text file, called "UniqueHashes.txt"
Task: Essentially what I need to do now is to go through the entire Raw folder and copy EACH file that has a matching MD5 hash, to one of the hashes in the UniqueHashes.txt.
What I was thinking of doing was: Looping through RAW using find . -type f, and then hashing each file, and comparing that hash to every line in the unique hash list that I created. If it exists in the unique hash list, then copy that file (preserving time stamp) into DD, else, ignore that file.
It needs to be in BASH. You're help is greatly appreciated. I don't expect you to hand me the answer in code, but if you do it, then that would be awesome. However, any guidance you can give me to approach this problem would be amazing!!!
Thanks in advance!