SED command detailed

Source: Internet
Author: User

function: SED is a stream editor, which is a very important tool in text processing and can be used perfectly with regular expressions. When processing, the currently processed rows are stored in a temporary buffer called pattern space, followed by the SED command to process the contents of the buffer, and after processing is done, the contents of the buffer are sent to the screen. Proceed to the next line, repeating until the end of the file. The file content does not change unless you use redirection to store the output. SED is mainly used to automatically edit one or more files, to simplify the repeated operation of the file, to write the conversion program and so on. command format:
sed [options] ' command ' file (s) sed [options]-F scriptsfile file (s)

Options:

-
e <script>--expression: Process input text files with the specified script in options - F <script>--file: script specified in Options File to process the input text file- n--quiet: Show only results after script processing

SED command:

a\ Insert text below current line i \ Insert text above current line c \ Change selected line to new text d Delete, delete selected row d Delete first row of template block s replaces the contents of the specified character H copy module board into memory buffer h appends the contents of the template block to the in-memory buffer g to obtain the contents of the memory buffer and overrides the text in the current template block. G Gets the contents of the memory buffer and appends the text in the current template block. List of characters cannot be printed

                                 

SED command detailed

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.