I am trying to copy specific subdirectories (and the files contained in them) to a new directory. Assuming I am in the first directory (
dir0/), this contains a number of subdirectories named
002/, ... and so on. Each of these subdirectories contains 1000 sub-subdirectories, with files inside them. One example could be:
I have a .txt file containing a list of the subdirectories to copy (I only have the name of the subdirectories, not the full path), so, for the example above, my txt file will contain this information:
Is there a way to copy all the subdirectories whose names are included in the txt file to a new directory using bash or python?
Thank you for your help. I am new to both bash and python.