Tagged Questions
4
votes
4answers
190 views
How to shift filename numbers without collisions?
Consider this list of files:
$ touch index-{1,2,3,4,5,6,7,8,9}.txt
If I want to shift them down so they start at zero, it's relatively easy:
$ rename --verbose 's/^index-([1-9])\.txt$/$1/; ...
4
votes
3answers
414 views
For each subfolder, sort files by name and rename them to sequential padded numbers (regardless of extension)
I have the following directory structure:
.
├── event-a
│ ├── album-a
│ │ ├── a.jpg
│ │ └── x.png
│ └── album-b
│ ├── a.jpg
│ ├── x.png
│ └── y.gif
└── event-b
├── ...
4
votes
1answer
244 views
Renaming files from bash in linux
There is a bunch of files of the following format hh-mm-ss.png where hh, mm, ss are hour, minute and second. How can I rename all these files in the directory in a sequential way from 1.png til n.png ...
2
votes
2answers
156 views
Move one file at a time based from specific number in the files
Based from this question, The HTML files date format has been changed. All of the HTML files have the date such like below:
20110730dateishere
dateishere is intentionally added by me in the files, ...
2
votes
3answers
719 views
sorting filenames numerically when they have non-numeric prefix
I have files in the following format: x1 x2 ... x10 x11 ... x101 ...
I want to rename these files, so they all have the same name length: x001 x002 ... x010 ...
I can do this with files, that don't ...