sed:一种常见的 Unix/Linux 命令行工具,名称来自 stream editor(流编辑器),用于对文本流进行按行处理与自动化编辑(如查找替换、删除、插入、打印特定行等)。在脚本与管道(pipeline)中非常常用。
/sɛd/
Sed replaces text in a file automatically.
sed 会自动替换文件中的文本。
Using sed with regular expressions, she cleaned thousands of log lines and extracted only the error messages for the report.
她使用 sed 搭配正则表达式,清理了成千上万行日志,并只提取错误信息用于报告。
sed 是 stream editor 的缩写形式。它起源于早期的 Unix 工具链,设计目标是让用户能在“数据流”通过时进行快速、可脚本化的文本编辑,而不必打开交互式编辑器。