Wondering if you can help. I have thousands of filenames like this:
2016-IMG123
IMG124
2018-13727-IMG123
I’m trying to create a one liner in terminal to rename all these files in a folder to leave just the last 6 chars.
for f in *; do mv "$f" "${f%?????}"; done
This was my starting point but I’ve find using the for loops a little confusing. Most example code talks about removing x number of chars from the front, rather than only leaving 6 chars by removing any additional from the start.