查找多个XML文件中的‘Hello World’
grep -rnw '/dir/dir/dir' \
-e 'hello world' \
--include=\*.xml \
--color
查找并替换多个文件中的字符串
grep -rl 'hello world' /dir/dir/dir/ | xargs \
sed -i 's/hello/goodbye/g'
其中,-r 表示递归,-l 表示只显示文件名。