I have the following folder and files:
.
├── photos
│ ├── photo-a
│ │ ├── photo-a.meta.json
│ │ └── photo-a.json
│ ├── photo-b
│ │ ├── photo-b.meta.json
│ │ └── photo-b.json
...
There are more folders and files in the photos folder in the same structure
I would want to copy all the files photo-a.json
, photo-b.json
and others into another folder called photos-copy
. Basically, I want to exclude all the files that end with .meta.json
but copy only those that end with .json
files.
So, if done correctly, photos-copy
folder would look like this:
.
├── photos-copy
│ ├── photo-a.json
│ └── photo-b.json
...
I tried something along cp -a ./photos/*.json ./photos-copy
but this will end up copying everything because the .meta.json
files also end with .json
extensions.
How can I do this?