In Unix "less", can I jump to the next line that does NOT contain X?

Yes, this is non-match search functionality, for example:

less file.conf

then you type / and after that ! your last line should look like:

Non-match /

then type your pattern for example Non-match /^# to look for first line without beginning #

Instead of ! character you can also use Ctrl+N.


As an addition to Casual Coder's answer:

You could also filter out the lines altogether:

<logfile grep -v mypattern |less 

The disadvantage is that you have to quit and restart grep to change the pattern; the advantage is that the lines you don't want to see are hidden, which makes it easier to spot interesting patterns in the lines that you are interested in.

Tags:

Unix

Grep

Less