CentOS Linux Server Guide

Displaying file content with scroll function in CentOS Linux

less command is the enchanced version of more command.

  • The less command + Up or Down arrow key operate similar as scroll bar. This will ease your viewing on the content of the file 

  • This command different from cat and more command. Using less command, you will can scroll the the entire content of the file UP and DOWN arrow key.

Command and Options:

less  [options] filename

 

 

Option:

 
Options   Description
-s squeezing multiple blank lines into one
-E quit the view mode session after reaching end of file (EOF)
-c clear the screen from the top for next display
+/character string specifies a string that will be searched for before each file is displayed, and displays text  text two lines before the string appears at first time

 

Examples:

 

The the following example will display file content on screen. If the file content is more than a page, the command will let you scroll down or up using arrow key.
less mail.log

 

 

Keyboard Operations:

 
Keyboard key function
Up Arrow Key scroll up the screen output a time
Down Arrow Ket scroll down the screen output a time
q quit the view operation mode

 

Back to Managing Files and Folders in CentOS Linux

 



Copyright 2011 http://www.1a-centosserver.com All Rights Reserved

All trademarks are the property of their respective owners.

Contact Us | Terms of Use | Privacy Policy