I would expect the following command to delete all files with extension .x or .z, but instead it seems to only delete the first file listed:
mkdir foo
touch foo/{a.x,b,c.z}
find foo -type f -name '*.x' -o -name '*.z' # correctly lists a.x and c.z
find foo -type f -name '*.x' -o -name '*.z' -exec rm -f {} \+
# only deletes c.z
Why is this happening?