I have a directory structure like this:
Bookname Edition 1
Bookname Edition 1 type1.pdf
Bookname Edition 1 type2.pdf
Bookname Edition 2
Bookname Edition 2 type1.pdf
Bookname Edition 2 type2.pdf
I want to recursively change the name from Edition
to Volume
of the directory and the filenames in those directories.
I started off with this and that's fine if I'm in the directory:
for f in *.pdf; do
a="$(echo $f | sed s/Edition/Volume/)"
mv "$f" "$a"
done
Then I tried this to change all files under the directories, and that's when I got stuck...
Please can you tell me how to do this or give me a better way of doing this. There are 15000 PDFs in 100 directories.
for
loop, I would assume nothing happened, but I want to confirm.