Shell Script Learning Summary----sed+grep+awk+ Regular

Source: Internet
Author: User

Shell Script Learning Summary----sed+grep+awk+ Regular

================================================================================

First part SED

================================================================================

I. INTRODUCTION of SED

SED is the stream editor. He is an indispensable tool in text processing, used in conjunction with regular expressions, the magic of the infinite! 650) this.width=650; "src=" Http://img.baidu.com/hi/face/i_f07.gif "alt=" I_f07.gif "/>

Second, the command parameters

-N prints only changed rows

-I modify source file

-E

G Full line substitution

Ng the current row matches to the nth start substitution

Iii. examples



================================================================================

Part Two awk

================================================================================




================================================================================

Part Three grep

================================================================================

First, grep introduction

The grep command is a text-search command on a Linux system that accepts regular expressions and produces a variety of outputs.

Second, grep command parameters

-I ignores case

-E Matching Regular

-V Take reverse

-N Generate line number

-C matches the number of successful rows

-L can search multiple text at the same time

-r-r Implementing Recursive Search

-E

--include

--exclude

--color=auto matches to a color display

Iii. examples

1. Echo ABCB abc abc abc|xargs-n 1|GREP-I ABC

650) this.width=650; "Src=" Https://s1.51cto.com/oss/201710/19/98a64c309a6ab4004e1672228bf93e6b.png-wh_500x0-wm_3 -wmp_4-s_1692162006.png "title=" 1.png "alt=" 98a64c309a6ab4004e1672228bf93e6b.png-wh_ "/>


================================================================================

Part IV-Regular expressions

================================================================================


This article from "Doublelinux" blog, declined reprint!

Shell Script Learning Summary----sed+grep+awk+ Regular

Related Article

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.