PDA

View Full Version : Search command in less


nvn
Sep24-09, 10:51 PM
When perusing a file using the linux less command, and you use the less search command inside less, I would like to know how to make less not display the line containing the target search string as the very top line of the session window (very poor design). I want the target line to always be at least the fourth line down from the top of the window (or lower), so I can see the found string in context, showing a few lines before (and after) the target line. Any help would be appreciated.

nvn
Sep25-09, 11:39 PM
Problem solved. The problem is solved by using the less -jn option, explained on the less man page.