How do I transfer all the contents of a file based on a criteria to another folder? I have multiple folders i.e., Fold1_part1 which have 6 subdirectories in them. In each of them has 3 folders full of images labelled either 0,5,10. I am trying to move them to another folder which will hold all the images for each category(3 folders which are 0, 5 or 10).
In Terminal
mkdir -p path/to/target/{0,5,10}
cd path/to/Frames
mv */*/0/* path/to/target/0/
mv */*/5/* path/to/target/5/
mv */*/10/* path/to/target/10/

PS: Use mv -i to get prompted in case of identically named files.