Home > Mobile >  Look for all images in the system then copy them to a folder
Look for all images in the system then copy them to a folder

Time:11-17

This is the code I used.

find . -regex '.*\(jpg\|jpeg\|png\|gif\)' \! -path './ToutesImages/*' -exec echo cp -t ToutesImages {}  

This is the terminal output

Because it shows me all images in the system and echoes my code i guess something with the -exec echo cp -t ToutesImages {} is wrong. Does anyone know how I can improve this?

File manager. Just in case

CodePudding user response:

The echo is there as a dry run so you can preview the command that will be executed. If it looks like the right set of files then delete it to actually perform the copy.

  • Related