Provided that you have no more than one ISO image in each subfolder, here is the one-liner, even three of them:
Code:
rename -vn 's:(/[^/]*)/[^/]*$:$1$1.iso:' folder/*/*.iso
Code:
for f in folder/*/*.iso;do dn="${f%/*}";echo mv -v "$f" "${dn}/${dn##*/}.iso";done
Code:
find folder/* -maxdepth 0 -type d -execdir sh -c 'test -f "$0"/*.iso"&&echo mv -v "$0"/*.iso "$0/${0##*/}.iso"' '{}' \;
The red parts are for testing purposes, remove them when you're sure it works as advertised. The last one is slightly more safe: if there are several .iso files in a subfolder then test -f $0/*.iso will abort with an error message as it expects just one argument.
Bookmarks