You are not logged in.
I recently ran photorec on an old drive. It managed to recover a lot of files, but they are in a large series of directories that do not correspond to the original directory tree. It is going to take a while to sort the mess out, but it would be beneficial to sort these files by filetype. I was never a bash guru, but at one point I'm pretty sure I wouldn't have had a problem with this!
So let me clarify: There is a directory called ~/backup. This directory contains many subdirectories (only one deep) that have files of all types, txt, jpg, etc... I would like to create a directory called ~/jpg and use a command to search all subdirs in ~/backup to mv or cp all files of type jpg to that dir. This command would probably involve "find ." with a pipe to mv or something, but I can't seem to figure it out on my own right now.
Thanks in advance
Last edited by Convergence (2011-03-08 20:26:20)
It's a very deadly weapon to know what you're doing
--- William Murderface
Offline
I'd copy first:
find ~/backup -name "*.jpg" -exec cp {} ~/jpg \;
and
find ~/backup -name "*.JPG" -exec cp {} ~/jpg \;
Note: This will overwrite all files of the same name.
Offline
that was perfect. thank you.
It's a very deadly weapon to know what you're doing
--- William Murderface
Offline