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

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

What Others Think

house cleaning rochester ny I knew that was the best!
yeoyeo · 48 weeks and 2 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 · 32 weeks and 1 day ago
I really like your blog. Great article. It's most evident, people should learn before they are able to ??
KayGasaway · 31 weeks and 6 days 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 · 30 weeks and 6 days 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 · 30 weeks and 1 day 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.">Onewheel Accessories
KayGasaway · 29 weeks 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 · 28 weeks and 1 day 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 · 27 weeks and 3 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 · 26 weeks and 4 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 · 26 weeks and 1 day 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 · 26 weeks 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 · 25 weeks and 4 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 · 25 weeks and 4 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!">Scrunch Butt Leggings
KayGasaway · 25 weeks and 3 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.">Kush-420
KayGasaway · 25 weeks and 2 days ago
Qikink enables anyone to sell products online without inventory, processing and logistics hurdles. Anyone can signup on and start selling products online. T-Shirt Dropshipping
jackson2321 · 25 weeks and 1 day 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 · 25 weeks 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 · 25 weeks ago
At Cape Cod Pool Repair, we make your backyard pool plastering and renovation projects easy, convenient and enjoyable. Cape Cod Coping Repair
jackson2321 · 24 weeks and 6 days 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">best property rentals
KayGasaway · 24 weeks and 5 days 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 · 24 weeks and 3 days ago
I would like to speak to someone about a puppy from your breeding program.">Altered Carbon Working Dogs
KayGasaway · 24 weeks and 3 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!">fence companies cape coral
KayGasaway · 24 weeks and 1 day 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 · 24 weeks ago
Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking. Michele Petit
KayGasaway · 23 weeks and 6 days ago
Class Companion | Class Attendance App | Class Management Software">Attendance App for Teachers
KayGasaway · 23 weeks and 5 days 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 · 23 weeks and 5 days ago
Pool Plaster Inc. | quartz plaster | Pool Renovation Services Boston quartzscapes
KayGasaway · 23 weeks and 1 day ago
Simple MovingSimple Moving Company | Residential & Commercial Moving Services commercial moving services
KayGasaway · 22 weeks and 1 day ago
I have added and shared your site to my social media accounts to send people back to your site because I am sure they will find it extremely helpful too. eye doctor broken arrow
KayGasaway · 22 weeks ago
Most complete guide on angelite meaning, benefits, spiritual connection to the Zodiac, birthstone, numerology, and feng shui Shop Angelite for sale.
ayesha · 21 weeks and 5 days ago
HighTimes-420 is an online cannabis store that provides the best Indica strains, pure Sativa, glass vape cartridge, and high-quality marijuana flowers.">cannabis seed to sale
KayGasaway · 21 weeks and 5 days ago
Come check us out if you want to buy weed online. There are many different things that we carry. Some of our more popular products include weed lollipop.
Back18021 · 19 weeks and 5 days ago
One place to avoid reduced price mattresses is purchasing at yard sales. There are no cleanliness standards and the history of the mattress is unknown. truck mattress
kenwood · 19 weeks and 3 days ago
No Deposit Casino Sites 2021 are quite a popular choice for players online, casino with no deposit is a very effective way to play online games without spending any capital start. No Deposit Casino Sites 2021
KayGasaway · 12 weeks and 6 days ago
seo what is seo search engine optimization
seofox · 3 weeks and 6 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? 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.


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: