用于正则表达式替换的 Bash 命令

Ale*_*lex 5 linux ubuntu bash regex pipe

什么 bash 命令可用于管道上的正则表达式替换?

     cat foo.txt | someprogram
Run Code Online (Sandbox Code Playgroud)

nik*_*nik 11

你可能想要

sed 's/exp1/exp2/g' foo.txt > foo2.txt
Run Code Online (Sandbox Code Playgroud)

Sed 教程另一个教程Linux HOWTO 上的一个小教程中阅读更多内容