再帰はglobやrglobがやってくれる
↓こういうので何か問題ある?

for x in Path(‘.’).rglob(‘test/‘):
__x.rename(str(x).replace(‘test’, ‘changed’))