文档内容如下:

# cat 123.txt
linux
cisco
huawei
network
system

1. 使用sed命令在cisco行下面添加CCIE;

# sed -i "/cisco/a\CCIE" 123.txt
# cat 123.txt
linux
cisco
CCIE
huawei
network
system

2. 使用sed命令在network行上面添加一行,内容是Security;

# sed -i "/network/i\Security" 123.txt
# cat 123.txt
linux
cisco
CCIE
huawei
Security
network
system

 

相关文章:

  • 2021-12-31
  • 2022-12-23
  • 2021-12-07
  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-03
相关资源
相似解决方案