How can I append characters to a files name in linux, using a regex? I've seen these two posts
- https://stackoverflow.com/questions/6985873/change-names-of-multiple-files-linux
- How to rename multiple files by replacing word in file name?
but haven't been able to get the answers to work for me. I'm also not sure if this belongs here, stack overflow or in another sub-site.
I've been trying
for FILE in \d+_\d+\.png; do echo "$FILE" $(echo "$FILE" | sed 's/\./_t\./'); done
but that doesn't seem to recognize the regexed filename as a regex.
So for data samples my files currently are
1111_2222.png
and I want them to be
1111_2222_t.png
The files are scattered amongst five directories. Thanks.