To remove all but a certain tag that doesn’t have spaces in its name, e.g., foo, I use
exiftool -overwrite_original_in_place -all= -tagsfromfile @ -foo input.jpg
But how to remove all but a certain tag that does have spaces in its name, e.g., foo bar? I have tried both
exiftool -overwrite_original_in_place -all= -tagsfromfile @ -"foo bar" input.jpg
exiftool -overwrite_original_in_place -all= -tagsfromfile @ "-foo bar" input.jpg
but neither seems to work for me.