#!/usr/bin/env zsh set -e setopt EXTENDED_GLOB for i (**/new) { pushd $i for m (*(N)) mv -v $m ../cur/"$m":2,S popd }