Ubuntu – How to move .doc and .xls files to a new folder

command linefiles

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.

Best Answer

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

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

would do the trick.