I have a txt file that include only the names of files that are in different sub-folders, I'm trying to write a function that will find this files and copy them to specific folder.
This is an example of my dir:
1
├── 2
│ ├── a.txt
│ ├── b.txt
│ └── c.txt
│
└── 3
├── d.txt
└── e.txt
This is an example of files_name.txt file:
a.txt
c.txt
e.txt
I tried this function I found those files but I couldn't copy them.
xargs -d '\n' -a files_name.txt -I FILENAME find 1 -type f -name FILENAME -exec cp {} DESTINATION_FOLDER: \;