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
  • 57,282
  • 43
  • 144
  • 200
Drew
  • 591
  • 1
  • 5
  • 22

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
  • 571
  • 1
  • 8
  • 15
  • 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
  • 193,181
  • 53
  • 473
  • 722
K7AAY
  • 16,864
  • 9
  • 45
  • 77
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.

Martin Thornton
  • 5,151
  • 11
  • 30
  • 39
Drew
  • 591
  • 1
  • 5
  • 22