Answer the question
In order to leave comments, you need to log in
How to write a .sh script to copy specific files with a specific archive name to a specific directory?
Good day! How to write a .sh script to copy specific files with a specific archive name to a specific directory?
Some details:
We have a ROM folder in which there is a START folder and in it a folder from the unpacked archive (there can be n-th number of folders with certain names) it has files (file_x, file_z, file_r, file_u, file_q, file_h, file_i ). From this / their folder / ok, you need to take file_u, file_z, file_i, file_q and make an archive / s with them, whose / s name is the name of the folder / ok. Then it / they need to be moved to another folder (for example, INPUT).
Answer the question
In order to leave comments, you need to log in
Answer:
cd /way
find . -type f -name "file_u" -o -name "file_z" -o -name "file_i" -o -name "file_q" | zip -r -j `basename "$PWD"` [email protected]
Do I understand correctly that you need to copy certain files but keep the directory tree?
give a couple of examples it was now
show an example of how many there were now
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question