search

Home  >  Q&A  >  body text

linux - grep如何在指定行的基础上 向上查找 包含特定字符的行

PHP中文网PHP中文网2787 days ago772

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 15:18:04

    Do you know why no one answered you?
    Don’t you know how to use pipes?
    ......|grep -A......|grep -B......
    Of course, you need to completely implement the function you mentioned, perl/awk, but obviously You need to be very familiar with regular expressions and related grammar to write it yourself. You may not be able to figure it out for a while.
    Regular tool learning order (increasing complexity):
    grep/egrep/fgrep/ack ->
    sed/ed/vim ->
    awk/perl

    reply
    0
  • Cancelreply