Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

emacs: inverse search

Tags:

emacs

Is there a way to do a inverse search? I have very big log file where a particular pattern fills up for few dozen pages

20100414 alpha beta
20100414 alpha beta
<few dozen pages>
20100414 alpha beta
20100414 gamma delta
20100414 gamma delta
<few dozen pages>
20100414 gamma delta

Problem is, I don't know what text would be after "alpha beta". It could be "gamma delta" or something else. So I would like to skip all the lines that contain "alpha beta".

like image 697
Data Avatar asked Apr 14 '10 19:04

Data


1 Answers

Two ideas:

  1. M-x keep-lines <RET> REGEXP <RET>

    will remove all lines not matching a regexp

  2. M-x grep <RET> grep -nH -e "<REGEXP>" -v <FILE>

    will find all lines in NOT containing your regexp.

like image 59
ostolop Avatar answered Sep 30 '22 12:09

ostolop