I'm trying to move a bunch of .doc and .xls files, which are stored in a bunch of folders and subfolders, to a new location. I previously tried cp -r **/{*.doc,*.xls} /wherever/you/want/
, which worked except that it didn't retain the directory tree faster.
Question: Is there a command/set of commands to purge all files except for .doc and .xls in a folder and its subfolders, yet retain directory tree structure?
And better yet, is there a command to remove empty folders, so I don't have to go through afterwards and manually delete empty folders?