i use this code to replace some text in an HTML file:
sed -i 's/tttt/new-word/g' /home/zjm1126/*.html
This doesn't search for files in subfolders, though. How do I apply this command to subfolders?
find /home/zjm1126/ -name '*.html' -print0 | xargs -0 sed -i 's/tttt/new-word/g'
Can you try somthing like
for z in `find /home/zjm1126/ -type f -name "*.html"`; do
sed -e 's/tttt/new-word/g' $z>temp;
done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With