0

I recently recovered a drive that was corrupted. it has a ton of extra files I do not need but I do need to copy files by extension over to the new location, eg: .jpg .png .mov .mp4 .wav .pdf .doc ext, ther are held in multiple sub directories along with a lot of crap files. like .java and .txts

Seth
  • 58,122
Drew
  • 601
  • 1
  • 6
  • 24

3 Answers3

0

Open a terminal

cd /media/drew/recovered-drive/home/drew
cp -r *.jpg /home/drew/Pictures
cp -r *.mov /home/drew/Videos
etc...

Does this help?

penner
  • 581
  • does not work get error "cp: cannot stat '*.jpg' No suhc file or directory" – Drew Oct 08 '13 at 22:14
  • sudo does not change the outcome... it seems that it should work though, odd – Drew Oct 09 '13 at 19:29
  • Oh... those file paths might not actually exist. I was just giving examples of what you could do. While you are typing that in, try tab competition. Or see this article for help: https://help.ubuntu.com/community/UsingTheTerminal – penner Oct 09 '13 at 20:34
0

Lazy man's way is to delete the junk files first.

find . -name "*.java" -type f|xargs rm -f
find . -name "*.txt" -type f|xargs rm -f
muru
  • 197,895
  • 55
  • 485
  • 740
K7AAY
  • 17,202
0

Using rsync -avm --include='*.ext' -f 'hide,! */' "dir" "dir", I completed the task and made a .sh script duplicating the method for the other extensions.

Drew
  • 601
  • 1
  • 6
  • 24