Head display Text Header command English intent
Command format
Command function
- Head is as simple as its name, which is used to display the first number of chunks of text, and the head is used to show the beginning of the file to the standard output, while tail is looking at the end of the file.
Common parameters
Common Example Example 1
Display specified first few lines
Example 2
Displays the first n bytes of a file
[[email protected] test]# head -c 20 log2014.log2014-012014-022014[[email protected] test]#
Example 3
The contents of the file except the last N bytes
[[email protected] test]# head -c -32 log2014.log2014-012014-022014-032014-042014-052014-062014-072014-082014-092014-102014-112014-12[[email protected] test]#
Example 4
Output file except the last n rows of the entire content
[[email protected] test]# head -n -6 log2014.log2014-012014-022014-032014-042014-052014-062014-07[[email protected] test]#
Linux File Management head