Grep,sed,cut,awk,join Personality Characteristics

Source: Internet
Author: User

Grep

queries/extracts rows that contain specific keywords from the data file.

Sed

Used primarily for substitution processing of specific strings in a data file.

Cut

Cuts the contents of the selected column (-F num) or the character (-c) by the specified delimiter (-D).

Awk

Often used to display only specific fields, or to rearrange the order of fields in a row.

Join

A file used to combine fields with a common key value in a record.

---------------------------------------------------------------I'm a split line----------------------------------------------------- -----------------

The following two effects are the same

awk ' {print $} ' /etc/passwdcut1 /etc/passwd

Change the space between awk default two fields as * * * *

awk -F:-v'ofs=*****'{print $,$/etc/ } ' passwd

awk Prints the last field

awk ' {print $NF} ' /etc/passwd

Awk can not only print the selected fields

awk ' {print "User", $, "is using this shell", $NF} ' /etc/passwd

Grep,sed,cut,awk,join Personality features

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.