sed

以可用脚本的来批量编辑文本。 更多信息:https://keith.github.io/xcode-man-pages/sed.1.html.

sed 's/{{查找内容}}/{{替换内容}}/' {{文件名}}

sed -E 's/{{正则表达式}}/{{替换内容}}/g' {{文件名}}

sed --in-place='' 's/{{查找内容}}/{{替换内容}}/g' {{文件名}}

sed '/{{行模式}}/s/{{查找内容}}/{{替换内容}}/' {{文件名}}

sed -n '{{行号}},/^$/p' {{文件名}}

sed -e 's/{{查找内容}}/{{替换内容}}/' -e 's/{{查找内容}}/{{替换内容}}/' {{文件名}}

sed 's#{{查找内容}}#{{替换内容}}#' {{文件名}}