Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

While we're talking less(1) features, one I stumbled across a few years ago when wishing really hard that less supported an interactive regex line filter, was its interactive regex line filter:

    &pattern
Which will: Display only lines which match the pattern; lines which do not match the pattern are not displayed. If pattern is empty (if you type & immediately followed by ENTER), any filtering is turned off, and all lines are displayed.

I'd prefer this followed a syntax closer to mutt's filters, and that the patterns were editable (e.g., typing '&' during a filter would show the currently extant filter for modification), but it's handy.



> I'd prefer [...] that the patterns were editable (e.g., typing '&' during a filter would show the currently extant filter for modification)

If you type '&' then the up arrow, you'll get the previously entered pattern(s), which you can then edit.


Bless you. I didn't know that.

Which is why I share tips like this -- it's almost always a win.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: