head command can display the contents of the file before the file specified number of lines, the basic format is as follows: head [Option] File Name
Options:
Options | meaning |
---|---|
-n K | Where K represents the number of rows, the option to display the contents of the current file line K; if you use "-K" as a parameter, then all but the last K lines of the file, the entire contents of the remaining displays. |
-c K | Where K represents the number of bytes, this option to display the file before the K bytes of content; If "-K", it indicates that in addition to the contents of the last K bytes of the file, the entire contents of the remaining display. |
-v | It displays the file name; |
Note that, the specific number of lines displayed as not provided, the default text data 10 line.
E.g:
head -n 20 is anaconda- the ks.cfg 20 is displayed Pre #
Can also write directly "- the number of lines," such as:
head -20 anaconda-ks.cfg