Linux bulk replaces strings contained in all files

Source: Internet
Author: User
Sed-i "s/original string/new string/g" ' grep original string-rl. '
Format: Sed-i "s/lookup field/replace field/g" ' grep lookup field-rl path '

Turn:

Bulk Replace file content under Linux 1, ready-made data format on the network: sed-i "s/lookup field/replacement field/g" ' grep lookup field-rl path ' linux sed bulk replace strings in multiple files sed-i "S/oldstring/news Tring/g "' grep oldstring-rl yourdir ' Example: Replace the www.admin99.net in all files under/home to Admin99.net sed-i" s/www.admin99.net/ Admin99.net/g "' grep www.admin99.net-rl/home ' exp:sed-i" s/shabi/$/g "' grep shabi-rl./' 2, add yourself additional 2.1 to the text within 1.txt of the file" GA Rden "Replace with" Mirgarden "# sed-i" s/garden/mirgarden/g "1.txt   //sed-i very simple 2.2 replace" garden "in all files in the current directory with" Mirgarden "# # # s Ed-i "s/garden/mirgarden/g" ' ls '//is actually the LS out of multiple filenames

Turn from:

Http://www.cnblogs.com/end/archive/2012/05/24/2517131.html

  

 

Linux bulk replaces strings contained in all files

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.