awk && sed (4) ====linux The Three Musketeers of the awk command

Source: Internet
Author: User

Http://www.cnblogs.com/ginvip/p/6352157.html


This is a blog I found, the content of awk is written very well, need to see


awk about! No.


(1) Take odd lines

[[email protected] shell]# SEQ 10 | awk ' I=!i '

1

3

5

7

9



(2) Take even lines

[[email protected] shell]# SEQ 10 | awk '! (i=!i) '

2

4

6

8

10


(3) SEQ 10 not after 4 lines

[[email protected] shell]# SEQ 10 | Head-n-4

1

2

3

4

5

6




This article is from the "It Life" blog, so be sure to keep this source http://dingxue.blog.51cto.com/12290895/1974369

awk && sed (4) ====linux The Three Musketeers of the awk command

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.