Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Oct 18 '11 at 8:23

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

3 Answers 3

up vote 78 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
              examined.
       :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
2  
:e [file] Examine a new file. -- i.e. open a new file while less is open –  JellicleCat Jun 30 at 15:30
3  
+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 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 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 at 17:35

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 at 9:51

Type :n and :p.

share|improve this answer
    
Thanks a lot for input –  Jesper Rønn-Jensen Nov 16 '09 at 10:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.