2

I am wandering if there is a way to read the full output of a command when it uses more than the screen. I am currently having to output the command into a file, and then using nano to scroll through it.

E.g. $ ls -Al /etc/ only displays the end of the output and cuts of the rest.

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
Krii
  • 225
  • 1
  • 12

3 Answers3

4

You need to use less less is a pager, it allows you to view a page at a time. e.g.

command | less
ls -Al /etc | less

The most common command while in less are:

  • enter advance one line
  • space advance one page
  • q quit / exit help
  • h help

see man less for more info, like how to search.

1

That's possible by pressing shift + pg up.

More information on scrollback and the scrollback buffer can be found here.

Jan
  • 7,772
  • 2
  • 35
  • 41
0

Pipe any command's output into less and it will allow pagination, searching nd whatnot.

ls -lA /etc | less

As 'less' is displaying your text, hit h for help, read and ponder. man less - more to read.

Hannu
  • 494