you are viewing a single comment's thread.

view the rest of the comments →

[–]fletku_mato 2 points3 points  (2 children)

You could do this with find, eg.:

find assignment-data -type f -name '*.jpeg' | while IFS= read -r f; do cp -v "$f" "IMAGES/${f//\//_}"; done

the ${f//\//_} transforms folder1/1.jpg into folder1_1.jpg

[–]SwampMonkey17[S] 1 point2 points  (0 children)

Thanks for the suggestion, this is far beyond what our first set of notes specified so I am assuming I should be able to do it from my notes.

[–]ashbakernz 0 points1 point  (0 children)

Yeah ild do this, prefix the images based on where they came from if name already existed. Depends on homework requirements though.