i have several php files, and there's references to .html files in those.
I need to replace ".html" to ".php"
how can i do this in bash ?
i have several php files, and there's references to .html files in those.
I need to replace ".html" to ".php"
how can i do this in bash ?
Try sed:
find -name "filenamepattern.php" -print0 | xargs -0 sed 's/\.html/\.php/g'
for file in $(find . -name "*.php"); do
sed "s/\.html/.php/g" $file > $$ && mv $$ $file
done
GNU find
find /path -type f -iname '*.php' -exec sed -i.bak 's/\.html/\.php/g' {} +;