top | item 31010853

(no title)

bofh23 | 3 years ago

Alternatively, you can use less(1) in tail mode to search growing logs.

  less +F -p pattern /path/to/log
(Ctrl-C to break out of tail mode. /pattern to interactively set search pattern.)

discuss

order

philsnow|3 years ago

Also while inside less: & shows you only lines which match a pattern. You can hit & multiple times and less will show you only those lines which match every input pattern. A ^N right after & negates the pattern. & respects the -I switch (case insensitive pattern matching).

I use this all the time, especially when I'm on a machine that I don't want to bother installing something like fzf on.

hddqsb|3 years ago

Good tips. Small correction: `&` only filters by the most recent pattern.