I'm looking for a bash scrypt to copy some folders and some of the content to another location. I'm a teacher and very noobish with programming language anyway what I'm looking for , I have this director structure
Main director "Students" with subfolders "john";"daisy";"work" etc .. and some of the folders contain a specific file for example "exam.dat" , I need a scrypt that will check every folder in students for the file "exam.dat" and copy that folder and this file to another location, without copying other files inside folders or folders that doesn't contain exam.dat.
Hope I'm explicit enough. Thank you in advance