HeadAndTailAs simple as its name, it is used to display the beginning or end of a certain number of blocks of text,HeadTo display the beginning of the file to the standard output, andTailIt is the end of the file that is taken for granted. 1. Command format:Head[parameters] ... [File] ...2. Command function:Headused to display the beginning of the file to standard output, the default head command prints the first 10 lines of its corresponding file. 3. Command parameters:-q Hide file names-v Display file name-c< bytes >number of bytes displayed-n< Number of lines >number of rows displayed4. Use instance: Instance 1: Displays the first n rows of the file command:Head-N5Log2014.log[[email protected] test]#CatLog2014.log the- on the- Geneva the-Geneva the-Geneva the- to the- . the- - the- , the- the the-Ten the- One the- A==============================[email protected] test]#Head-N5Log2014.log the- on the- Geneva the-Geneva the-Geneva the- to[[email protected] test] #实例2: Displays the first n bytes of the file command:Head-C -log2014.log output: [[email protected] test]#Head-C -Log2014.log the- on the- Geneva the[[email protected] test] #实例3: The contents of the file except the last N bytes command:Head-C- +log2014.log output: [[email protected] test]#Head-C- +Log2014.log the- on the- Geneva the-Geneva the-Geneva the- to the- . the- - the- , the- the the-Ten the- One the- A[[email protected] test] #实例4: Output file except for the last n rows of the full content command:Head-N-6log2014.log output: [[email protected] test]#Head-N-6Log2014.log the- on the- Geneva the-Geneva the-Geneva the- to the- . the- -[Email protected] test]#
Linux Command Learning notes: Head command