Files are -
new_file.dat01,
new_file.dat02 and so on
i want to rename it as new_file_01.dat, new_file_02.dat
and so on.
Any ideas on how to do it?
Files are -
new_file.dat01,
new_file.dat02 and so on
i want to rename it as new_file_01.dat, new_file_02.dat
and so on.
Any ideas on how to do it?
What about:
for f in *file.dat*; do mv "$f" "$(echo "$f" | sed -E 's/.dat(.*)/_\1.dat/')";done