Open main menu

Changes

m
Add reminder at the top
{{Notice|Don't forget the <code>-i</code> option to make your file edit "in place"}}
== Move Nested Files to Flat Date Structure ==
Just like in the [[Organize music files]] article, you might need to organize your Photo files. Let's say you use [[Shotwell]] to organize your files on import, but inadvertently switch the structure of imported files from YYYY-MM-DD to YYYY/MM/DD Big difference. How do you quickly move hundreds of files from the latter to the former structure?
find /home/greg/Pictures/2017/ -type f | grep --perl-regex -v '/\.' | sed 's%/home/greg/Pictures/2017/\([0-9][0-9]\)/\([0-9][0-9]\).*%mkdir -p "/home/greg/Pictures/2017-\1-\2" \&\& mv "&" "/home/greg/Pictures/2017-\1-\2/"%'
</source>
 
When you're done with that, you'll have some detritus left over in your filesystem. <code>find /home/greg/Pictures/2017/ </code> will show you what's there, and adding the <code> -delete</code> option to find will delete those files.
== Resources ==