Head commands in CentOS

Source: Internet
Author: User
Head Name: head-outputthefirstpartoffiles upper-end content syntax of the input document: head [option] file function description: head and tail are very straightforward, it is used to display the beginning and end of a certain number of text blocks, head is used to display the beginning of the file to the standard output, tail is used to view the end of the document. Parameter:-n? -V? Verbose head

Name:Head-output the first part of files

Syntax: head [option] file

Function description:Head and tail are very straightforward. they are used to display a certain number of text blocks at the beginning and end. head is used to display the beginning of the file to the standard output, and tail is used to view the end of the document.

Parameters:

-N? Lines

-V? Verbose output file name

-C? Bytes display by the specified number of bytes

-Q quiet: hiding file names

Instance:

1) display the first four lines of the file

[Root @ bogon ~] # Head-n 4 test. log

123

234

345

456


2) output content except the last three lines

[Root @ bogon ~] # Head-n-3 test. log

123

8

9

10

10 is excluded. You need to check the first few rows, then add a number or-4 to the end of-n. If it is excluded, it is-n (minus sign)-4, and the last four rows are excluded.


------------------------------ Subsequent self-Summary -------------------

I think this head function is still very simple, and I have not found any complicated usage changes on the network. Paste it if someone else has it.


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.