CentOS Linux Server Guide

Displaying the start of file in CentOS Linux

Head command is used to display the first few lines of a file.

  • The default number of lines displayed is 10

SYNOPSIS:

head filename(s)

head -n filename(s)

 

Note:

-n option refer to number of lines that you want to display

 

Scenario A

In the following example, the head command (without using any option) will displaying the first 10 lines of the mail.log
head mail.log

 

Scenario B

In the following example,  the head -20 will displaying the first 20 lines of mail.log
head -20 mail.log

 

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