Wednesday, October 21, 2015

Rename the the file name in linux

One of my dir i had lot of ".xml.back" files and i really want to convert all the files into ".xml"!!  and end-up with this [1] statement.

[1]
find . -name "*.xml.back" -exec bash -c 'mv "$1" "$(sed "s/\.xml.back$/.xml/" <<< "$1")"' - '{}' \;