Shell Programming Four Musketeers practice--awk

Source: Internet
Author: User

Awk is a powerful text analysis tool, with the search for grep and the editing of SED, which is especially powerful when it comes to analyzing data and generating reports. To put it simply, awk reads the file line-by-row, using spaces as the default delimiter to slice each row, and then perform various analytical processing of the cut.

AWK has 3 different versions: AWK, Nawk, and gawk, which are not specifically described, generally referred to as the GNU version of awk, Gawk,gawk.

AWK is the abbreviation for three names: Aho, Peter Weinberg and (Brain) Kernighan. It was these three people who created awk---an excellent scanning and processing tool for style.

A few simple applications:


1. Show a Byte

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7A/37/wKiom1alvX2AVnpwAAAYVsILZFI420.png "title=" Clipboard.png "alt=" Wkiom1alvx2avnpwaaayvsilzfi420.png "/>


2. Show only users in/etc/passwd

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/7A/36/wKioL1alvhmxLT88AAFQ4LB8LKI577.png "title=" User.png "alt=" Wkiol1alvhmxlt88aafq4lb8lki577.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/7A/37/wKiom1alvg_xEQYNAAAUS7Ts9i0693.png "title=" User.png "alt=" Wkiom1alvg_xeqynaaaus7ts9i0693.png "/>


Displays the shell for the account and account, and the TAB key between the account and the shell

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/7A/37/wKioL1alv1ej_LDzAAAh7atkY0o125.png "title=" Awk.png "alt=" Wkiol1alv1ej_ldzaaah7atky0o125.png "/>

3. Retrieving IP

650) this.width=650; "style=" width:630px;height:326px; "src=" http://s5.51cto.com/wyfs02/M01/7A/37/ Wkiol1alwjezpcgiaamnhavwvfk524.png "title=" ip.png "border=" 0 "height=" 326 "hspace=" 0 "vspace=" 0 "width=" 630 "alt=" Wkiol1alwjezpcgiaamnhavwvfk524.png "/>


4. Retrieving the usage of the root directory "/"

650) this.width=650; "style=" width:630px;height:178px; "src=" http://s4.51cto.com/wyfs02/M02/7A/38/ Wkiol1alwxaxxfzwaagmxgpmcra113.png "title=" df.png "border=" 0 "height=" 178 "hspace=" 0 "vspace=" 0 "width=" 630 "alt=" Wkiol1alwxaxxfzwaagmxgpmcra113.png "/>

This article is from the "Records" blog, so be sure to keep this source http://lwj421.blog.51cto.com/7119945/1738251

Shell Programming Four Musketeers practice--awk

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.