more Command in linux

Back

Larger files demand a command that can help you scroll through the file text at your leisure. Linux has two of these commands : more and less

With the more file-name command, you can scroll through the text of a file, from start to finish, one screen at a time. With the less file-name command, you can scroll both directions through the same text with the PAGE UP and PAGE DOWN keys. Both commands support  vi style searches.

As the less and more commands do not change files, they are an excellent way to scroll through and search for items in a large text file such an error log. 

For example :

To search through the basic /var/log/messages file, ruin the following command.
# less /var/log/messages
Once you have run the command you will be taken to the screen showing the output.

The less command has one more feature as compared to more and cat, it can read text files compressed in Gzip format, normally shown with the .gz extension. 

For example :

The man pages associated with many standard commands that are run  in the shell can be found in the /usr/share/man/man1 directory. 
All of the files in this directory are compressed in .gz format. It can read those file without un-compressing them.