I have a shared folder on my server containing many hundreds of family photos, mostly jpg's, but also littered with HUGE movies (.mov), and other large type files. I've promised a couple family members a disk of photos (jpgs). I created a directory on my Desktop called PicCD - the idea being I'd populate it with the hierarchically DATE named photo files (example: ./2018/07/04/{photo_file_name.jpg), then burn it to CDs or DVDs when I got the size appropriate to the medium. The file naming system started years ago by Shotwell and maintained ever since.
Having hopefully give you sufficient info, I've researched and constructed a find command that is pretty much what I (in this initial stage) am looking for, but there's a glitch prompting this question:
Is there a bash regex to strip out the "./" from the second expansion of "{}" that I can include in my command - I am trying to recreate the tree' destination as many pics have the same name:
Code: Select all
find -iname "*.jpg" -exec cp {} $HOME/Desktop/PicCD/{} \;
I have more 'lesser puzzles' on which to wok after this is solved, but that doggone "PicCD/./1986 ..." is clobbering me. Then there's there's the photos getting re-dated to the date in which I perform my copy; but that's another day.cp: cannot create regular file ‘/home/User/Desktop/PicCD/./1986/DuckGoosingGoose.jpg’: No such file or directory
Thank you.