bash grep newline

后端 未结 11 1811
渐次进展
渐次进展 2021-01-04 12:38

[Editorial insertion: Possible duplicate of the same poster\'s earlier question?]

Hi, I need to extract from the file:

first
second
         


        
11条回答
  •  日久生厌
    2021-01-04 12:56

    So you just don't want the line containing "first"? -v inverts the grep results.

    $ echo -e "first\nsecond\nthird\n" | grep -v first
    second
    third
    

提交回复
热议问题