Linux display text Specify line contents

Source: Internet
Author: User
Primarily SED, head, and tail commands if the text uses \ n such symbols, the cat command treats it as a newline character, resulting in an error of $ sed-n "10p" move.sh # showing line 10th

$ sed-n "7,10p" move.sh # Show lines 7th through 10th

$ Cat Recorde | Head-n 10|tail-n 1 # shows line 10th, first 10 rows, and then the last line in the 10 rows

$ Cat Recorde | Tail-n +10 | Head-n 1 # shows the 10th row, first the 10th line and the next, and then the first line here

Tail-n #显示最后100行

Tail-n +1000 # Starting from 1000 lines, displaying 1000 rows after all rows

Head-n 1000 # show Front 1000 lines

Linux display text Specify line contents

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.