Return to Snippet

Revision: 31201
at September 1, 2010 03:53 by jarnaldich


Initial Code
ls -d *.foo | sed -e 's/.*/mv & &/' -e 's/foo$/bar/' | sh

Initial URL

                                

Initial Description
To rename a bunch of files from "*.foo" to "*.bar" (like windows' REN *.foo *.bar) in unix.

Looking at the solution, it is easy to adapt it to more powerful character substitutions on  a 1 to 1 basis.

If you want to test what will be executed before doing so, just drop the last pipe.

Initial Title
Batch rename with wildcard support in Unix

Initial Tags
unix

Initial Language
Bash