Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UNIX: Move files from subfolders to another folder

Tags:

unix

I have a directory containing folders and subfolders. These subfolders contain, for example, .xml files.

I'd like to copy all of the .xml files into a separate folder. My UNIX is rusty; any and all help would be greatly appreciated. Thanks, Adam

like image 905
Adam_G Avatar asked Dec 07 '22 13:12

Adam_G


1 Answers

Do you mean copy all .xml files from all subfolders without having to specify the subfolder names?

find . -name \*.xml -exec /bin/cp {} /dest/dir/ \;
like image 72
theglauber Avatar answered Jan 13 '23 16:01

theglauber