test.txt原文内容
http://jsldfjaslfjsldfjasl/test?jlsdfjsalfjslfd
使用sed替换
sed -ri 's/(http:\/\/)[^\/]*(\/test)/\1localhost:8888\2/' test.txt

test.txt替换后内容
http://localhost:8888/test?jlsdfjsalfjslfd

相关文章:

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