Pages

Thursday, February 27, 2014

Search and replace multiple files with substitution

$ find . -name "*.txt" | xargs -n 1 perl -pi -w -e "s/text([0-9])/other\$1/g;"

Does a search and replace across multiple files with a subgroup replacement.




commandlinefu.com


by David Winterbottom (codeinthehole.com)






from All commands http://ift.tt/1eDJ4Do

No comments:

Post a Comment