Uniformly correct filenames in a directory

for i in *;do mv "$i" "$(echo $i | sed s/PROBLEM/FIX/g)";done
Useful if non-ascii characters in filenames have been improperly encoded. Replace "PROBLEM" with the incorrect characters (e.g. 'é'), and "FIX" with the correct ones (e.g. '?').

3
2009-06-28 01:50:25

What Others Think

Nah! You don't need to use sed for that. Use bash's parameter expansion (search and replace on variables): for i in *; do mv "$i" "${i/PROBLEM/FIX}"; done
flatcap · 700 weeks and 1 day ago
Why not just use the 'rename' command? rename 's/PROBLEM/FIX/g' * man rename
jmcantrell · 700 weeks and 1 day ago
Thank you. I didn't use those methods because I didn't know about them. I'll be better prepared next time.
AlecSchueler · 700 weeks and 1 day ago
the rename invocation that jmcantrell has cited is for the prename command (usually symlinked from rename) which comes with perl, at least on my ubuntu system.
bwoodacre · 700 weeks and 1 day ago
It's woven in my soul huge help
yeoyeo · 67 weeks and 1 day ago
We should that way being near God is truly set out toward the entire people. Click https://www.sentencecorrector.biz/what-services-can-correct-sentences-online-free/ for getting strong contemplations. It will guarantee about solace and satisfaction our lives.
Ingram47 · 22 weeks ago
This base can be supervised considering the course that there are encountering minor mutilations in it. Visit http://www.sentencecorrection.org/use-help-of-our-english-grammar-sentence-correction-tool/ to make work on time. Absolving whatever else, the proprietor of this base is drawn nearer to put all sources inside concerning the dividers.
Ingram47 · 22 weeks ago
The Brussels question has taken so sharp surprising making turns in the road. Visit https://www.grammarcheckeronline.org/3-facts-you-didnt-know-about-grammar-fixer/ for additional subtleties. Finally the Jury of IGC should make an additional standard and sensible perspective.
Ingram47 · 22 weeks ago
Encountering beast figuring all that out is the colossal right of each magnificent adult. I reliably visit http://www.englishgrammarcheck.org/oxford-english-grammar-grammatical-forms-and-how-they-are-used-in-standard-british-english-today/">http://www.englishgrammarcheck.org/oxford-english-grammar-grammatical-forms-and-how-they-are-used-in-standard-british-english-today/ to concentrate on additional nuances. Regardless of meanwhile, there are wearisome such people in our country who have not obtained the beast postgraduate training of figuring everything out yet.
Casper47 · 17 weeks and 4 days ago
Getting on the web postgraduate course isn't exactly titanic and head including all potential means as by a wide edge most consider. Click www.englishgrammarcheck.org/instant-grammar-checker-excellent-result-in-a-few-seconds/ to oversee everything on time, it should be put at the most raised motivation driving the need list that this illuminating point of view will require more self-inspiration.
Casper47 · 17 weeks and 4 days ago
To make the picked edifying chart all the all the truly persuading, you can't simply utilize any of the stuffed toys. We are looking through this to anticipate that you. Visit http://www.copychecker.org/how-to-remove-plagiarism-paraphrasing-techniques/ for extra nuances which are very perfect. You can visit with your stuffed toy maker and uncover to them that you truly need to make them as learning gear.
Casper47 · 17 weeks and 4 days ago
Pug Puppies for Sale Near Me pugs puppies for sale teacup pugs for sale pug puppies for sale by owner pug puppies ohio PUG PUPPY FOR SALE NEAR ME PUG PUPPIES FOR SALE pug puppies for sale in kentucky Pug Puppies for Sale Under $500 Near Me pug puppies for sale in texas pug puppies for sale $200 pugs for sale near me under $500 pugs for sale under $400 near me pugs for sale near me puppies for sale near me under $500 pug puppies for sale under $1,000 near me pug for sale pug puppies for sale under $300 Brindle Pug Pitbull Pug Mix Pugs for sale cheap Cheap pug affordable pug puppies for sale near me black pugs for sale near me White Pugs for sale pug dog for sale free pug puppies pug puppies for sale in my area mn pug breeders pug puppies indiana pugs for sale michigan PUG PUPPY ADOPTION Pug puppies for sale Pug puppies for sale near me Pug puppies near me Pug Puppies for Sale Under $500 Near Me Cute Pug Puppies Black pug puppies Black pug puppies for sale pug puppies for adoption black pug puppies for sale near me chihuahua pug mix puppies how much is a pug puppy teacup pug puppies baby pug puppies pictures of pug puppies pug puppies for sale in Ohio pug puppies price pug mix puppies teacup pug puppies for sale best food for pug puppy newborn pug puppies pug puppies craigslist pug puppies for sale craigslist adorable pug puppies how much does a pug puppy cost Pitbull pug mix puppies pug pit mix puppy pug puppies for sale $200 pug puppies for sale in NJ Pug puppies for sale in Wisconsin pug puppy cost pug puppy food royal canin pug puppy royal canin pug puppy food fawn pug puppy pug puppies for sale florida pug puppies for sale in Indiana pug puppies for sale in KY pug puppies for sale in NC pug dog puppy AKC Registered Pug Puppies For sale cheap pug puppies for sale near me cheap pug puppies for sale in California cheap pug puppies for sale in nj Black Pug Puppies for sale pugs puppies for sale pug puppies indiana Amazing! This blog looks just like my old one! It's on a completely different subject but it has pretty much the same layout and design. Wonderful choice of colors!
rahimhh21 · 12 weeks ago
Since 2008, Perfect House Pug Puppies has been the leading Pug puppy breeder in the US, providing premium Pug puppies for sale. Each puppy exhibits the professionalism and knowledge that have set Perfect House Pug puppies apart from other pug puppy breeders. The professionals at Perfect House Pug Puppies are dedicated about finding their puppies loving, beloved homes where they can enjoy long, healthy lives. A companion that has been produced for quality, health, and temperament that satisfies the breed standard is guaranteed by Perfect House Pug puppies, the pug breeder that has set the benchmark for exceptional customer satisfaction. If you are looking to buy a baby pug, Black and white pugs, Mini pug puppies for sale, Black and tan pug for sale, Teacup pug puppies for sale, Female pug puppies, pug puppies for sale, pug puppies for sale near me, pug puppies for sale under $500 near me. Pug Puppies for Sale Near Me pugs puppies for sale teacup pugs for sale pug puppies for sale by owner pug puppies ohio PUG PUPPY FOR SALE NEAR ME PUG PUPPIES FOR SALE pug puppies for sale in kentucky Pug Puppies for Sale Under $500 Near Me pug puppies for sale in texas pug puppies for sale $200 pugs for sale near me under $500 pugs for sale under $400 near me pugs for sale near me puppies for sale near me under $500 pug puppies for sale under $1,000 near me pug for sale pug puppies for sale under $300 Brindle Pug Pitbull Pug Mix Pugs for sale cheap Cheap pug affordable pug puppies for sale near me black pugs for sale near me White Pugs for sale pug dog for sale free pug puppies pug puppies for sale in my area mn pug breeders pug puppies indiana pugs for sale michigan PUG PUPPY ADOPTION Pug puppies for sale Pug puppies for sale near me Pug puppies near me Pug Puppies for Sale Under $500 Near Me Cute Pug Puppies Black pug puppies Black pug puppies for sale pug puppies for adoption black pug puppies for sale near me chihuahua pug mix puppies how much is a pug puppy teacup pug puppies baby pug puppies baby pug puppies for sale pictures of pug puppies pug puppies for sale in Ohio pug puppies price pug mix puppies teacup pug puppies for sale best food for pug puppy newborn pug puppies pug puppies craigslist pug puppies for sale craigslist adorable pug puppies how much does a pug puppy cost Pitbull pug mix puppies pug pit mix puppy pug puppies for sale $200 pug puppies for sale in NJ Pug puppies for sale in Wisconsin pug puppy cost pug puppy food royal canin pug puppy royal canin pug puppy food fawn pug puppy pug puppies for sale florida pug puppies for sale in Indiana pug puppies for sale in KY pug puppies for sale in NC pug dog puppy AKC Registered Pug Puppies For sale cheap pug puppies for sale near me cheap pug puppies for sale in California cheap pug puppies for sale in nj Black Pug Puppies for sale pugs puppies for sale
Perfecthomepugs · 3 weeks and 6 days ago
Thanks for another wonderful post. Where else could anybody get that type of info in such an ideal way of writing? MVP coaches
sophiacharlie · 1 week and 1 day 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: