A couple of options spring to mind. rsync --dry-run -av --prune-empty-dirs --exclude '*.meta.json' --include '*.json' photos/ photos-copy/ Or if you don't have `rsync` (and why not!?), this will copy the files retaining the structure cp -av photos/ photos-copy/ rm -f photos-copy/*/*.meta.json This variant will flatten the files into a single directory cp -av photos/*/*.json photos-copy/ rm -f photos-copy/*.meta.json You can do more fancy things with `bash` and its extended pattern matching, which here tells the shell to match everything that does not contain `.meta` in its name: shopt -s extglob cp -av photos/*/!(*.meta).json photos-copy/