I'm trying to make a script where I move data from an archive and copy it to a new directory where it can be modified. The problem is the archive also has many extraneous files that I will not be using, so I don't want those copied over.
Right now I have things set up as follows:
cat $fileName | \
while read line
cp -R Contents*/ /modify_folder/$linedone
So this code will go to my modify_folder and open a text file with a list of folders (markers). It will then use this list of markers and iterate through the archive and copy the Contents folder (and all its subfolders) to the modify_folder, so in the end you'll have:
Both with the same data. Without having to script the removal of the extraneous files, is there a way to restrict the filetypes that are copied? That is let's say we have zip files and txt files, and I just want the zip files copied. At the same time I want to maintain the file hierarchy. I hope that's clear, any suggestions? Thanks.