I have a lots of log file in a directory and it's sub directory named as dataupload_sales_.xxx.com.dat
. I wanted to change all files xxx.com
part to yyy.com
in current and sub directories.
i hope it's not a duplicate post as i have search the forum and tried few option but none of them worked. some post suggested to use rename and it's only rename in single file. where i have 5000+ sub directories in my directory and every sub directories have 100+ .dat
files.
i have also tried
find ./ -name "xxx.com" -exec bash -c 'mv $0 $(echo "$0" | sed -r \"s|xxx.com|yyy.com|g\")' '{}' \;
it shows invalid directory error