Download   Online Shop   Red Hat Network
Home  |  Products & Services  |  Support  |  Training  |  Partners  |  Documentation   
Red Hat Documentation

Keep ls Output from Scrolling

Keep ls Output from Scrolling

Q: When ls Output Scrolls Off the Screen

Whenever I type ls I can barely see the output of the directory because it scrolls by too quickly. How can I actually read the output?

A: "Piping" the Output of ls

You can prevent the output of ls from scrolling by too quickly by piping the output to a pager, such as less or more. The results are akin to the DOS command dir somedirectory /p, because you'll see the output one screen, or "page" at at time.

To read the output of /etc with less, for example, at the shell prompt, type:

ls -al /etc | less
          

To move forward a screen, press Space; to move back a screen, press the B key; to quit, press Q.

You can achieve the same results with more, another pager.

Printing Output of ls

You can also print the directory by piping the output to a printer in the same way that you piped the output to your screen. Assuming you've configured a printer, to pipe the output type:

ls -al /etc | lpr
		

 

 
 
Search for:  on    Powered by Google
Products & Services   :   Download   :   Support   :   Training   :   Partners & Programs
© 2001 Red Hat, Inc. All right reserved.       About Red Hat   :   Legal statement   :   Privacy statement   :   Y2K statement   :   Contact Red Hat