![]() ![]() This is to say that the solution resembles the problem. I've chosen this approach-among many possible approaches-because the command expresses precisely the naming scheme that you wish to operate on. ![]() It's possible to write a shorter rename command that ought to work. This helps avoid renaming files you don't want to rename. If the file does not begin with the necessary pattern, then there is no match. The backslash is necessary because when a dot appears in a regular expression it otherwise matches any single character. The effect is to ensure those characters are present just before the part we will actually replace. These are the characters we want to keep, after all, not the ones we want to replace. \K forgets the preceding matched characters.I suggest this, though I'll show an alternative below: rename -n 's/^\d matches a sequence of exactly eight digits. The rename command (you can also run it as file-rename) is well-suited to this task.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |