Shell Lookup and substitution

Source: Internet
Author: User

In the shell to find, grep is doomed to escape.

Cat file grep Austin

is to look in the document for the row where Austin is located.

After grep matches the regular expression, the Find function becomes exceptionally powerful.

At this point, it's good to be familiar with regular expressions. In this case, it will be more handy to deal with some problems.

Also have to mention the two editors sed and awk.

Sed is a stream editor. It is a batch way to edit the file. Can be used to do some work such as text substitution.

cat /etc/passwdsed's/:.*//'  sort -U
cat /etc/passwdcut1,5

Join can be used to join fields

Shell Lookup and substitution

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.