I use / for search. Once I press enter I use n and N to navigate. If I press / again though the old pattern is lost. 90% of the times I want to append the pattern and I have to retype, which I naturally hate it. Is there an option to append the current pattern in less?

1 Answer 1


less remembers previous searches (even from previous executions, if you have a history file — ~/.lesshst by default). To access them, press / and the arrow keys. For your specific use-case, you’d press / , less will show the previous pattern with the cursor at the end of the pattern, and you can type the additional pattern.

  • 1
    So simple and yet, it didn't cross my mind... Thanks. (8 minutes to go) Commented Jan 26, 2018 at 14:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .