Text find and replace in directory ubuntu command

by Francis 2014-02-27 10:41:53

Text find and replace in directory ubuntu command
Easy way to find and replace old text to new text in terminal


cd /directory/
perl -pi -e 's/oldtext/newtext/g' *


Replace with specific extension files
Here in php file text only find and replace,

find /home/user/directory -name *.php -exec sed -i "s/cybernetnews/cybernet/g" {} ;

1058
like
0
dislike
0
mail
flag

You must LOGIN to add comments