I have a folder with images named:
pic001-2.png
pic002-2.png
pic003-2.png
How do I rename them to the following?
pic001.png
pic002.png
pic003.png
I have tried mv "pic*-2.png" "pic*.png" but keep getting errors.
|
|
|
This will delete the first
To test it, just prepend |
|||
|
|
|
You need the appropriately named 'rename' command! Try something like this:
It takes a perl regular expression as the first argument, so your pattern-matching and manipulation options are pretty extensive. See the rename(1) man page for full details. |
|||
|
|