linux command What is sed and awk used for?

Source: Internet
Author: User

Very powerful text manipulation tool, Sed,awk,grep This three command is the operation of the text file
The UNIX system has several very special features:
1. For the kernel, UNIX files are byte sequences. IO devices are also files.
2. The meaning of the document is referred to the application for interpretation. The text files are very important because UNIX provides a lot of utilities (utility), which are relatively independent, but can be piped to implement interprocess communication (IPC) so that loose coupling can accomplish complex operations. So what is the data format for inter-process communication? In fact, for utilities, this data format is a simple text file. In addition, IO redirection is also a good idea. What format does the content in the text file use? This very specific command is relevant, so manipulating the text becomes very important. Grep,sed and awk are the three commands for manipulating text files.
grep Search
Sed modifies and edits some lines in a text file
Awk is accessing a text file, manipulating some data in a text file
Do you understand?

Sed can be understood as the abbreviation for Stream editor, which is the text flow editor. Working with text in an action unit, you can insert rows, delete rows, replace inline text, and more.
There are two key concepts of records and fields in awk, usually the default line is a record, and a record can be split into multiple fields by the specified delimiter (the default is a space or tab). So awk is more flexible and powerful (and has a lot of built-in functions and variables to use).
There are too many ways to use the concrete. A powerful thing is not something that few words can do. There are many tutorials available online, such as:
Sed-an Introduction and Tutorial.doc
Awk-an Introduction and Tutorial.doc

What does the Linux command sed and awk do, and how do I use it?

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.