Answer the question
In order to leave comments, you need to log in
How to optimize bash code?
Good afternoon, the task is the following, it is necessary to move files from different directories into one. The problem is that you need to check if there is such a directory or file, and the same check goes for each directory/file. How to optimize? There is one option in my head, to create an array of strings that will contain the names of these files and iterate over these names with a for loop, but the search will be in all directories.
Answer the question
In order to leave comments, you need to log in
Alternatively, use rsync . You just have to be a little confused in order to merge several paths into one.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question