Common Linux commands (13) and common linux commands

Source: Internet
Author: User

Common Linux commands (13) and common linux commands

The head and tail are just as easy to understand as their names. They are used to display a certain number of text blocks at the beginning or end, and the head is used to display the beginning of the file to the standard output, and tail takes it for granted that it is the end of the file.


1.Command Format:

Head [parameters]... [file]...


2.Command function:

The head command is used to display the beginning of the file to the standard output. The default head command prints the first 10 lines of the corresponding file.


3.Command parameters:

-Q: Hide the file name.

-V: display file name

-C <byte> display Byte Count

-N <number of rows> Number of displayed rows


4.Instance used:

Instance 1:Display the first five lines of a file

Command: head-n 5 log44.log


Example 2:Display the content of the file except the last 6 lines

Command: head-n-6 log44.log


Example 3:Display the first 20 characters of a file

Command: head-c 20 log44.log



Example 4:Display the content of the file except the last 32 characters

Command: head-c-32 log44.log






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.