How to read backward from the end of file in less or more

lesssolarisunix

I've found one way so far: less +G filename, but it scrolls up line-by-line only with .

What's a more powerful less usage which provides scrolling by page, backward pattern search, and so on?

Best Answer

I'm sure someone else has a better answer, but

With "less" after you've opened the file:

G goes to the bottom of the file

^b goes up one page

? searches backwards.

As you said, you can open the file with +G and then use ? and ^b to scroll up. There are likely clever awk things you can do to achieve the same thing in a script.