13

Replacing a particular string in all files in folder and file contents

view full story
linux-howto

http://www.unix.com – I need to replace all filesnames in a folder as well as its content from AK6 to AK11. Eg Folder has files AK6-Create.xml, AK6-system.py etc.. the files names as well as contents should be changes to AK9-Create.xml, AK9-system.py etc All files are xml and python scripts. ---------- Post updated at 10:32 AM ---------- Previous update was at 10:01 AM ---------- Eventually i found out This worked find . -name "*AK6*" -print|awk '{f=$0;gsub("AK6","AK11");print "sed -e 's/AK6/AK11/g' "f" > "$0}'|sh (HowTos)