Checkout these great crochet books, movie and TV DVDs (some are so new they aren't published yet! pre-order them at amazon.com!), and other items I enjoy or are on my wish list!

Use rename to change multiple filenames

| 1 Comment


I {heart} UNIX! In addition to the 'find' commend, I just found another very useful command that is now my second favorite!

rename

The rename command renames files according to a pattern, such as:

I needed to rename almost 800 files from a format like "2007_XXXXXXXXXXXXXX.php" to use a hyphen (dash) instead of the underscore after the year - such as "2007-XXXXXXXXXXXXXX.php". I did this with the following for each year (there's probably a way to rename all years at once, but I didn't have a backup and didn't want to screw it up):

rename 2007_ 2007- 2007*.php

which means "change the string 2007_ to 2007- in all filenames resulting from 2007*.php".

Worked like a charm!!!

I am not responsible for any problems you may encounter. Backup all files first.

1 Comment

Cheers for this, didn't realise the command existed! From looking at the man page it appears you can use the `-n` flag to preview the changes the command makes before applying them.

Leave a comment

Sketch of Cheryl

About Cheryl

Enjoys crocheting, gardening, cats, NASCAR (especially Tony Stewart and Kyle Busch!), reading, photography, snorkeling in Kailua-Kona with sea turtles, Sizzler's Mega Bacon Cheeseburgers, hot and iced decaf coffee, dark chocolate, color (yarn, fabric), playing around with web technologies - not necessarily in that order! Still very much a beginner with quilting, knitting, and sewing. Donates crocheted lap blankets.

List maker, detail-oriented, organized, leans heavily toward perfectionism. ISTJ. Libra.

Late 40s. Married to Bill. Son Greg and daughter-in-law Lauren live in Oregon. Stepson Billy and daughter-in-law Rowena are in Maui, Hawaii. Stepson Bryan lives in the Bay Area.

Web Designer for a college in the Bay Area, California. Strives for web accessibility, web standards, valid XHTML, valid CSS.

Tea Party Patriots.
Fiscal responsibility, limited government, free markets.
www.teapartypatriots.org

January 2012

Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

I Care About

(Most links open new window.)

  • My wonderful cat Cleo.
  • Give Life. Donate Blood. Red Cross.
  • Learn about breast cancer at BreastCancer.org
  • Tony Stewart 14
  • Stewart-Haas Racing
  • Kyle Busch 18
  • NASCAR
  • YOU on a Diet - RealAge.
  • Get the Firefox web browser - it's Safer, Faster, Better!

TMM Blog ClustrMap

Locations of visitors to this page

Disclaimer

This is a personal website - my place of self expression. The views expressed are mine alone and do not necessarily reflect the views of my employer or any other organization I am a member of or affiliated with.

OpenID accepted here Learn more about OpenID
Creative Commons License
This blog is licensed under a Creative Commons License.
Powered by Movable Type 5.04

About this Entry

This page contains a single entry by Cheryl published on October 27, 2007 3:02 PM.

100020 miles was the previous entry in this blog.

The move to MT 4 so far is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Archives

Categories

Cat playing with strand of yarn.

Recent Comments

  • Matt Button: Cheers for this, didn't realise the command existed! From looking read more