Replacing multiple files in batches in Linux

Source: Internet
Author: User
Tags perl script
In Linux, you need to create a new Branch under SVN to replace multiple files in batches. the script for project deployment must also be updated, starting with svn. there are more than a dozen sh files, which is too troublesome to manually change. The following describes how to replace multiple files in batches: find-name & amp; #39; FILE_NAME & amp; #39 ;... in Linux, you need to create a new Branch under SVN to replace multiple files in batches. the script for project deployment must also be updated, starting with svn. there are more than a dozen sh files, which is too troublesome to manually change. The following describes how to replace multiple files in batches: find-name 'File _ name' | xargs perl-pi-e "s | OLD_STRING | NEW_STRING | g" the Perl language is used here, perl-pi-e: add the-e option to the Perl command, followed by a line of code. then, it will run the code like running a common Perl script. args can take the output of one command as the parameter of another command. Find/-name *. jpg-type f-print | xargs tar-cvzf images.tar.gz
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.