I would like to copy range of jpg files from the multiple folders.
I have a lot of folders with *.CR2 and *.xmp, in addition, it has a jpg folder with *.jpg files. I need to copy only jpg files and save file structure.
example:
2018/folder1/jpg –> temp/folder1/jpg
2018/folder2/jpg –> temp/folder2/jpg
Can this be automated? not to go to every folder and copy the files?
I tried Unix command:
cp folder1/*.jpg to folder1/jpg and got *.jpg: no such file or directory
Best Answer
If I understand correctly what you're asking...
You can change directory into the
2018
directory, e.g.:Then use, e.g.:
This will copy the
folder*/jpg
directories in2018
totemp
so you'll havetemp/folder*/jpg
directories, wheretemp
it at the same level as the2018
directory.In other words, as in your examples:
They will be created as you've shown.