ustclug / Linux101-docs

Linux 101 学生课程教材与讲义
https://101.lug.ustc.edu.cn
Creative Commons Attribution Share Alike 4.0 International
664 stars 64 forks source link

Ch06: Fix instruction for sed command #37

Closed yusanshi closed 1 year ago

yusanshi commented 1 year ago

强调一下 sed 替换文本时不加 g flag 会替换每一行的首次出现。

  1. https://unix.stackexchange.com/questions/210766/why-does-sed-replace-all-occurrences-instead-of-only-the-first-occurrence
  2. https://stackoverflow.com/questions/148451/how-to-use-sed-to-replace-only-the-first-occurrence-in-a-file