I would like to rename all directories under a basedir which match a name. For example:
In basedir/, I have:
basedir/
- foo/bar/blah - my/bar/foo
find . -depth -name bar -type d -execdir mv {} baz \;
-execdir changes directory to the parent before executing the command, so the mv here will be local to each parent directory.
-execdir
mv