linux-Command-sed-awk

Source: Internet
Author: User

command: sed [options] Flow Editor, change file additions and deletions, three Musketeers dick

Parameters:

-N: Cancel default output

P: (print) printing

e.g. sed-n ' 20,30 ' P ett.log print ett.log 20-30 lines of content

e.g. sed-n ' $ ' p ett.log print the last line in Ett.log, $ is the end of the file

Command: awk [options] filter output, Three Musketeers boss

Parameters:

e.g.

[email protected] log]# awk ' nr>19&&nr<31 ' Ett.log

Explanation: NR is a line number

Command: grep [options] Three Musketeers old three

Parameters:

-A: In addition to displaying a matching row, and displaying the NUM lines after thatline (after)

-B: In addition to displaying a matching row, and displaying the NUM line before the line (before)

-C: In addition to displaying a matching row, and displaying the previous and subsequent NUM lines

linux-Command-sed-awk

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.