I need to rename approximately 50,000 files and can’t find regex examples that work. Here is the pattern for all the filenames
myfiletitle.jpg_download=12500
The numeric IDs at the end of the filenames are all the same length — 5 digits — and all the filenames follow this pattern. From a Bash shell, I want to run a batch rename to restructure the filenames as follows:
12500_myfiletitle.jpg
This should be easy but I just can’t get the regex to work. I’ve had some success with the following, but overall I can’t get the full solution:
s/\(.*\).../\1/
Thanks in advance!!
This is using
sed-like regular expressions, as hinted at in the question’s illustrative regex. In Perl, you’d write: