Use search history in the 'less' pager

Oct 08, '02 09:37:48AM

Contributed by: osxpez

This is probably man page stuff but I just discovered it. With less, when searching forwards (using /) or backwards (using ?) in the file, you have a history of old searches available. So if you have searched forwards for lines starting with home (using /^home), you can search backwards for the same pattern by typing ? and the press up-arrow on the keyboard. You can also edit the search string. Perhaps non-surprising among vim power users. But mighty cool!

Also, if you type F (be sure to make that upper-case) when lessing a file, less will scroll to the end of the file and keep doing it as more data is added to the file. Analogous to tail -f.

Comments (1)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20021008063748345