测试文件test.txt内容

aaa
ab
abcd
eeee
sed -n '/aaa/p'  test.txt 

sed 命令总结

2 替换特定字符串

sed -n 's/aaa/ccc/p'  test.txt 

sed 命令总结

3 在文件中替换特定字符串

sed -i 's/aaa/ccc/g'  test.txt 

sed 命令总结

相关文章:

  • 2021-11-30
  • 2021-04-14
猜你喜欢
  • 2022-02-21
  • 2021-07-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案