It's easy to replace words in each file with sed all at once, but it's troublesome to apply sed to multiple files at once, so I tried to find out how to do it all at once.
For example, if you want to change the description of http://www.ubuntu16.04 in all html files in the current directory to https://ubuntu18.04
find . -name "*.html" | xargs sed -i 's;http://www.ubuntu16.04;https://ubuntu18.04;g'
It's okay. find xargs sed Please find out how to use each.
By the way, if you use this on Mac, an error may occur, so at that time
find . -name "*.html" | xargs sed -i '' 's;http://www.ubuntu16.04;https://ubuntu18.04;g'
Try. I put a space and two single quotes after -i.
Recommended Posts