Incremental searching with the `less` utility



Does less have an incremental search?

I'm on xubuntu.


Posted 2010-02-26T05:00:39.970

Reputation: 4 556



Unfortunately the less pager does not have this functionality. The only search options available are / for a forward search, and ? for a backward search.

John T

Posted 2010-02-26T05:00:39.970

Reputation: 149 037

someone should implement that ability then ;) – hasen – 2010-02-26T06:23:13.657

according to the manpage: "n .. repeat previous search" ... isnt that incremental? – akira – 2010-02-26T07:20:56.290


Incremental usually means "search as you type". See

– mrucci – 2010-02-26T16:28:42.110


You can use view (vim in read only mode) as a replacement for less.. vim has incremental search, just add:

set incsearch

to your .vimrc


Posted 2010-02-26T05:00:39.970

Reputation: 5 915

I know about it but can you pipe text to it? i.e. use it as a pager for other tools (such as git) – hasen – 2010-02-27T02:08:17.287

1looks like vim comes with a script for that.. export PAGER=/usr/share/vim/vim71/macros/ or if you google 'vimpager' there is a supposedly better replacement.. git sort of has issues with it because of the terminal escape codes for color, but there might be an easy fix for that... – user23307 – 2010-02-27T11:04:59.540

I forgot about view – at. – 2010-02-27T23:55:11.980


I added incremental search to less and pushed it to a fork on GitHub.

Matt McClure

Posted 2010-02-26T05:00:39.970

Reputation: 283