linux工具——grep介绍 wangfengflyj 2021-04-26 152 阅读1分钟 使用grep正则表达式提取想要的字符串部分,而不是整体输出 #!/bin/sh cat xxx.log|grep request_in |grep uri_segment |grep -o '"app_id":"[0-9]*"' grep -n 输出行号 #!/bin/sh cat xxx.log|grep request_in |grep uri_segment |grep -no '"app_id":"[0-9]*"'