Situation: I finally convinced my dad to let me install Xubuntu on his desktop, since Windows XP had become extremely bloated, old - it's a mess. So I installed Xubuntu 12.10 alongside the Windows partition, and he wants me to move all his .doc and .xls files to the new partition before I erase the Windows partition. This is easier said than done. My dad has subdirectories upon subdirectories, and I really don't want to have to manually go through every single folder to get all his documents and spreadsheets.

Question: How do I move all his .doc and .xls files to a new folder?

Additional Info: I know there are ways to move all files, but I only want to move files of a certain type (.doc, .xls). I've already tried find "/media/gregory/Secondary/Documents and Settings/Gregory Davidson" -name '*.doc' | xargs -i cp /home/gregory/Documents, but when I manually checked, it hadn't moved the documents in many, if not all, of the subdirectories.


Assuming you are in the directory that you want to copy files from,

cp -r **/{*.doc,*.xls} /wherever/you/want/

would do the trick.

  • I forgot I would have to be in the original directory; Now I feel stupid :/ Thanks for the quick response! – DaimyoKirby Nov 22 '12 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.