infile search and replace on N files (including backup of the files)

perl -pi.bk -e's/foo/bar/g' file1 file2 fileN
the addition of ".bk" to the regular "pie" idiom makes perl create a backup of every file with the extension ".bk", in case it b0rks something and you want it back

10
By: xsawyerx
2009-01-29 09:51:11

What Others Think

house cleaning rochester ny I knew that was the best!
yeoyeo · 25 weeks and 4 days ago
This is a smart blog. I mean it. You have so much knowledge about this issue, and so much passion. You also know how to make people rally behind it, obviously from the responses. ???????
KayGasaway · 9 weeks and 3 days ago
I really like your blog. Great article. It's most evident, people should learn before they are able to ??
KayGasaway · 9 weeks and 1 day ago
Pretty nice post. I just stumbled upon your weblog and wanted to say that I have really enjoyed browsing your blog posts. After all I’ll be subscribing to your feed and I hope you write again soon! ????
KayGasaway · 8 weeks and 1 day ago
Superior post, keep up with this exceptional work. It's nice to know that this topic is being also covered on this web site so cheers for taking the time to discuss this! Thanks again and again! ??? ???
KayGasaway · 7 weeks and 3 days ago
I needed to thank you for this incredible read!! I unquestionably adored each and every piece of it. I have you bookmarked your site to look at the new stuff you post. http://mmfaces.mcgi.me/index.php?a=profile&u=thefloatlife">Onewheel Accessories
KayGasaway · 6 weeks and 2 days ago
A debt of gratitude is in order for posting this information. I simply need to tell you that I simply look at your site and I discover it exceptionally fascinating and educational. I can hardly wait to peruse bunches of your posts. Onewheel XR Accessories
KayGasaway · 5 weeks and 3 days ago
Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. Computer Support and Services companies near me Beverlywoods Los Angeles, California
KayGasaway · 4 weeks and 5 days ago
Waltery, as a top Chinese faux suede, PU leather supplier, is specialized in DMF FREE water-based PU, SOLVENT FREE PU, TRADITIONAL PU, microfiber leather, faux suede development, production and exporting. Waltery insists the highest quality and therefore the company’s laboratory does the rigorous testing process.
ayesha · 3 weeks and 6 days ago
Affordable Pool Repair provides the best pool restoration, renovation, gunite pool finishes, and pool coping in the area of Boston as well as New Hampshire. Residential pool repair
KayGasaway · 3 weeks and 3 days ago
The problem of erectile dysfunction (impotence) concerns an increasing number of men of all ages. What is the answer? The alternative are original and safe drugs for potency : Kamagra , Viagra, Cialis, Levitra, which we offer cheap and over the counter. Kamagra apteka
mohsinkhatri · 3 weeks and 2 days ago
If you’re looking for where to get top-notch samples for music, then you’ve come to the right place. Producers Wave has you covered for any music genre, format, DAW, or style. All our sounds are created by professional producers and sound designers for your inspiration. They are all royalty-free for both personal and commercial use. No attribution is needed. We believe there’s bound to be something here that matches your production. trap samples
KayGasaway · 2 weeks and 6 days ago
Our specialty: We are a team of music and fashion lovers committed to providing a service for people just like us. We provide great pieces that balance the music and fashion sides of our clients. We love our celebrities and provide a comprehensive service that caters to VIP members outside of retail hours. We also have a master barber on staff to add that extra something to your look.We are the cultural hub that mixes music and fashion equally for people of all ages. travel bags for women
KayGasaway · 2 weeks and 6 days ago
We give women a place to shop for athletic wear that was affordable, good quality and stylish. We know that keeping up with the latest trends and styles can be pricey. That is why we are here. Trendy and affordable all in one place. We got you girls! http://www.ellaathletics.com/">Scrunch Butt Leggings
KayGasaway · 2 weeks and 5 days ago
Buy high quality cannabis and vape proudcts from us at great prices. Weed, flowers, cbd oil, vapes, pre-rolls, extracts and have them delivered to you. http://www.hightimes-420.com/">Kush-420
KayGasaway · 2 weeks and 4 days ago
Qikink enables anyone to sell products online without inventory, processing and logistics hurdles. Anyone can signup on Qikink.com and start selling products online. T-Shirt Dropshipping
jackson2321 · 2 weeks and 3 days ago
All of our products are designed and hand crafted in Tennessee by local seamstresses.We follow God's Word and stitch a little extra love into every piece. knotted gowns
KayGasaway · 2 weeks and 2 days ago
Tutarchive is the premier and authentic blog publisher that shares knowledge & tips about online earning, digital marketing, freelancing & more! how do podcasts make money
KayGasaway · 2 weeks and 2 days ago
At Cape Cod Pool Repair, we make your backyard pool plastering and renovation projects easy, convenient and enjoyable. Cape Cod Coping Repair
jackson2321 · 2 weeks and 1 day ago
Welcome to Venus Rentals. We are a short term property management company that provides the best rental property management services and helps property owners to create passive income without the hassle of managing property http://venusrentals.com/">best property rentals
KayGasaway · 2 weeks ago
Providing affordable pool and hot tub services in Winnipeg and surrounding areas. We offer the best pool repair and hot tub maintenance services. pool service winnipeg
KayGasaway · 1 week and 5 days ago
I would like to speak to someone about a puppy from your breeding program. http://www.facebook.com/altrdcarbon">Altered Carbon Working Dogs
KayGasaway · 1 week and 5 days ago
If your fence is looking less than perfect, it is time for a fence repair in Cape Coral, SW Florida. Gator Fence is the best fence services company in SW Florida and nearby areas and we can give you a fence repair to prove it! A lot of our customers are extremely happy with the final result and I think it is your turn to be one of those customers! http://gatorfencecorp.com/">fence companies cape coral
KayGasaway · 1 week and 3 days ago
Daryl is an energetic professional CFO with a background in politics. Daryl has done fundraising, been a candidate, and worked in politically appointed positions in Pennsylvania and Philadelphia. Daryl has worked for Democratic candidates and nominees in 18 additional states. Daryl Lafountain
KayGasaway · 1 week and 2 days ago
Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking. Michele Petit
KayGasaway · 1 week and 1 day ago
Class Companion | Class Attendance App | Class Management Software http://criticoll.com/">Attendance App for Teachers
KayGasaway · 1 week ago
Axis Bank Fastag: How to Apply, Fastag login, Fee, Recharge Online and The charges applicable for reissuing a Fastag and insurance, latest charges etc. axis bank fastag login
jackson2321 · 1 week ago
Pool Plaster Inc. | quartz plaster | Pool Renovation Services Boston quartzscapes
KayGasaway · 3 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: