sed command in Shell

Source: Internet
Author: User

Sed-i '/CD ${ldir_dest}\/webextend\/pc && ln-s \/hard\/www_winclient\/bboxpc.exe./a\ \TCD ${LDIR_DEST}\/ WEBEXTEND\/PC && ln-s \/hard\/www_winclient\/' $i '. '

#参考别人后自己改的, it's mostly a variable.

Sed-i ' 4i dfsdfdsad ' xxx.txt #Insert contents between the fourth and fifth line is inserted in the 4th row, the original fourth row ran to V

#参考下边, some of the top.

Sed-i ' 4c Dfsdfdsad ' xxx.txt #Insert contents in the Lines 4 and overwrite the old on line 4th insert overwrite the original 4th row

#下边的是学的http://kaoshi.china.com/linux/learning/617077-1.htm

sed-i '/' "$test" '/d ' xxx.txt #删除某行, delete with content, this must add ' ""



Sed-i '/\[nand_para\]/a\flag = 1 ' filename.txt #这是别人的

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

sed command in Shell

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.