But what if I want to replace the log/ directory and after with another directory named xyz/ like:
CASE 1:
Before :/home/user/phase/dir1/log/
After: /home/user/phase/dir1/xyz/
CASE 2:
Before: /home/user/phase/dir1/log/Illinois/
After:/home/user/phase/dir1/xyz/