Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions

  




 

 

NOTE: CentOS Enterprise Linux is built from the Red Hat Enterprise Linux source code. Other than logo and name changes CentOS Enterprise Linux is compatible with the equivalent Red Hat version. This document applies equally to both Red Hat and CentOS Enterprise Linux.

14.9. Keep ls Output from Scrolling

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?

To prevent the output of ls from scrolling by too quickly, pipe the output to a utility such as less or more. You are then able to see the output one screen at at time.

To read the contents of /etc with less, type the following command at the shell prompt:

ls -al /etc | less

To move forward a screen, press [Space] bar; to move back a screen, press the [b] key; to quit, press [q] .

You can achieve the same results with more, another paging utility.

14.9.1. Printing ls Output

You can also print directory listings by piping the output to a printer in the same way that you piped the output to your screen. If you have configured a printer, type the following to pipe the output of a command to the printer:

ls -al /etc | lpr

 
 
  Published under the terms of the GNU General Public License Design by Interspire