The head command is similar to the tail command usage, and the head command is used to view the beginning of a specified number of character blocks in a document, displaying the first 10 lines of the document by default, and, if more than one file is given, a filename title before each file that is displayed.
1. Usage
head [Options] [file:]
2. Command options
-C,--bytes=[-]k K, displays the first K bytes of the document beginning,-K, does not display the last K bytes at the end of the document
-N,--lines=[-]k K, displays the first k line at the beginning of the document,-K, does not display the last K line at the end of the document
-Q,--quiet,--silent does not display the header of the file containing the given file name
-V,--verbose always displays the header of the file containing the given file name
--HELP Display this help message and exit
--version display version information and exit
3. Example
1) Display A.txt the first 5 lines of content
[Email protected] ~]#Cata.txt on GenevaGenevaGeneva to . - , theTen One A[[Email protected]~]#Head-5a.txt on GenevaGenevaGeneva to[[Email protected]~]#Head-N5a.txt on GenevaGenevaGeneva to
2) display the contents of the last 10 lines except A.txt
Head -N-ten
Linux Head Command