Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Use search history in the 'less' pager UNIX
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.
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)

Use search history in the 'less' pager | 1 comments | Create New Account
Click here to return to the 'Use search history in the 'less' pager' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Grep search alias
Authored by: kerbaugh on Oct 09, '02 07:55:58AM
I created an alias to do a grep search of my history. The search is case insensitive and I call the alias hgrep. The tcsh code for the alias is:
alias hgrep 'history | grep -i "\!{:1}" | grep -v "[h ]grep"'

[ Reply to This | # ]