I have a photorec
folder from a data recovery process that has 2481 folders with the recovered files.
The folder names are in the sequence recup_dir.1, recup_dir.2 ... recup_dir.2481
I got a list of all extension in these folders with this command:
find . -type f | perl -ne 'print $1 if m/\.([^.\/]+)$/' | sort -u
So I created another dir called photorecorg
with a list of folders corresponding to each extension I got with the above command:
mkdir 7z arj asf avi bat blend bmp bz2 cdr DOC docx flac flv gif gz html jpg mobi mov mp3 mp4 mpg ods odt ogg pdf php png ppt ps psd rar rtf svg swf tar tif ttf wav wmf xcf xls xlsx xz zip
Now I need to copy the files in the photorec
folder to the extension folders in photorecorg
:
I thought in something like find . -print | xargs cp $0 ../photorecorg/<extension>
What would be the command that can find the files and copy to each extension dir ?