I have a project with many directories named proj
$ find . -iname proj
./include/proj
./src/proj
./lib/proj
./share/proj
./doc/proj
I want to rename all these directories to test
with -exec mv
. I came up with find . -iname proj -exec mv {} test
but it doesn't work
find . -iname proj -print0 | xargs -0 rename.ul proj test
find . -depth -type d -name proj -execdir mv proj test \;
- you needdepth
andexecdir
- for details see Gilles' answer here... there's plenty of examples on this site, I just picked the first result in googlefind . -name proj -execdir mv {} test \;
find
will still complain (No such file or directory), just usedepth