Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have fired an ls -1 command that runs and displays a long list of values. When the command ends I can not see the output which is outside the screen vertical length. How can I see those previous entries ?

Is there a way to see the output progressively like :

  1. Display first 15 rows
  2. User hits a keystroke.
  3. Then display the next 15 records
share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

You can pipe the output of ls to pipe as follows

$ ls | less

Then you are able to use less to browse the output, for example with Page Up and Page Down. You can exit less by pressing q.

Type man less to find out more ways to scroll the output.

share|improve this answer
add comment

On older systems, or systems not having the very good less utility described by Stephane, you can use more which is part of the standart utilities.

Hit space to go to next page, enter key to go to next line, q to quit. You cannot "go back" and navigate into the output easily with more. less can.

share|improve this answer
add comment

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.