Replace string in files including subfolders

by Mohan 2014-09-11 19:09:31

Replace string in files including subfolders


 
grep -rli 'oldstring' --include=*.php | xargs -i@ sed -i 's#oldstring#newstring#g' @




this command replaces the 'oldstring' with 'newstring' in all php files within the directory (includes sub directories )
597
like
0
dislike
0
mail
flag

You must LOGIN to add comments