This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

For the record v opens $EDITOR with local file - not necessary vi/vim.
–
Maciej PiechotkaAug 30 '10 at 18:06

Edited in that change! Thanks Maciej! I did not know that one!
–
geoffcAug 30 '10 at 20:04

11 Answers
11

One can also use the mark feature to remember (and jump back to) specific positions in the file.

For example, type ma to mark a position with the label "a". To jump back to the position, simply type 'a. Labels can be any alphabet (case sensitive) thus allowing up to 52 possible marks ([a-zA-Z]) although I seldom use more than 2.

If you started searching for 'foo' and want to keep finding instances of it, you can hit / followed by return over and over, or you can just hit n (with no return) to keep on searching in the same direction.

-N - show line numbers

-I - ignore case in your search pattern (useful when looking for errors that might be spelled as 'ERROR|Error|error')

-G - turn off highlighting

You can type those while less is already viewing a file and they'll take affect on whatever file you're viewing. You can undo them by typing them again.

Although it took a question here to remind me how to do it, I always liked the -e or --quit-at-eof option of less.

This nominally causes any page down at the end of the file to quit out of less, but has the useful side effect that if you specified multiple files, it also causes a page down at the end of one file to take you on to the next. That can save loads of :n's if scanning through a bunch of files.