sed -i.bak 's/searchword/replaceword/g' file*.txt
# Or sed -i.bak '/searchword/s/searchword/replaceword/g' file*.txt
With bash 4.0, you can do recursive search for files
#!/bin/bash
shopt -s globstar
for file in **/file*.txt
do
sed -i.bak 's/searchword/replaceword/g' $file
# or sed -i.bak '/searchword/s/searchword/replaceword/g' $file
done
Or with GNU find
find /path -type f -iname "file*.txt" -exec sed -i.bak 's/searchword/replace/g' "{}" +;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…