Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just found out I can use less with multiple files. less status line tells me (END) - Next: file2.txt

But how do I navigate previous/next from less?

share|improve this question

migrated from Oct 18 '11 at 8:23

This question came from our site for professional and enthusiast programmers.

up vote 149 down vote accepted

We read in the manpage:

       :n     Examine  the next file (from the list of files given in the com‐
              mand line).  If a number N is specified, the N-th next  file  is
       :p     Examine the previous file in the command line list.  If a number
              N is specified, the N-th previous file is examined.
share|improve this answer
:e [file] Examine a new file. -- i.e. open a new file while less is open – JellicleCat Jun 30 '14 at 15:30
+1 stack exchange is faster than manual grep through man to find the right part when you're not sure how it's described. – Nathan Aug 5 '14 at 18:31
If a number N is specified - how to specify this number (can't find answer in the manpage)? – Piotr Dobrogost Nov 25 '14 at 16:53
@PiotrDobrogost: Good question. I had to fiddle a bit with it myself. Turns out the number precedes both the colon and the n or p. E.g., 3:n moves one to the third-next file. – Stephan202 Nov 25 '14 at 17:35

Type :n and :p.

share|improve this answer

Found out from :h (help window) that I can use :p (for previous) and :n (for next)

share|improve this answer
Teach a man to fish. I didn't know you could :anything, but now I know how to look using :h... – Mitch Kent Oct 15 '14 at 9:51

You must log in to answer this question.

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