Linux Command Learning notes: Head command

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.