Sed : print all lines after match

前端 未结 5 1446
-上瘾入骨i
-上瘾入骨i 2020-12-14 10:46

I got my research result after using sed :

zcat file* | sed -e \'s/.*text=\\(.*\\)status=[^/]*/\\1/\' | cut -f 1 - | grep \"pattern\"

5条回答
  •  轮回少年
    2020-12-14 11:21

    zcat file* | sed -e 's/.*text=\(.*\)status=[^/]*/\1/' | ***cut -f 1 - | grep "pattern"***
    

    instead change the last 2 segments of your pipeline so that:

    zcat file* | sed -e 's/.*text=\(.*\)status=[^/]*/\1/' | **awk '$1 ~ "pattern" {print $0}'**
    

提交回复
热议问题