/ Published in: Bash
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.
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.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
ls -d *.foo | sed -e 's/.*/mv & &/' -e 's/foo$/bar/' | sh