想象一个经典操作:`cat file.txt | sed 's/old/new/g'`。你可以把这个场景记为一个流水线(**S**tream):一只小猫(`cat`)吐出文字,经过一个叫`sed`的过滤盒子,盒子大喊一声“**S**ubstitute(替换)!”,把所有的‘old’都变成了‘new’。这样就把它的流处理核心功能和最常用的替换命令`s`联系起来了。
To replace all occurrences of 'apple' with 'orange' in the file, you can use the command: `sed 's/apple/orange/g' fruits.txt`. (要替换文件fruits.txt中所有‘apple’为‘orange’,可以使用此命令。)