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

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.


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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