2

How can I make less show the previous couple of lines when I search for something? I'd like to get rid of the kkk steps in my usual process:

  • /keyword
  • kkk
  • (read)
  • n
  • kkk
  • (read)

1 Answer 1

5
$ less -j 4 file

That will put the pattern you searched for on line 4 of the terminal.

To save typing this every time, you can put LESS=j4 into your environment.

You must log in to answer this question.