How to rename
sluno-20201027-call-metroua-status.mp4
sluno-20201103-call-deriva.mp4
sluno-20201103-call-metroua-status.mp4
sluno-20201105-call-makrocz.mp4
sluno-20201105-call-metroua-testcall.mp4
sluno-20201105-call-sluno-ggtabak.mp4
sluno-20201110-call-makrocz.mp4
sluno-20201110-call-metroua-status.mp4
sluno-20201110-call-sluno-utccz.mp4
to
sluno-call-metroua-status-20201027.mp4
sluno-call-deriva-20201103.mp4
sluno-call-metroua-status-20201103.mp4
sluno-call-makrocz-20201105.mp4
...
Simply move date / string on position 7-14
to the end of the name of file.
Thanks.
mmv works well for uncomplicated file renaming.
It may also be helpful to have some more reference points to be sure not to change the name on something else, especially where there may be other files in the same directory.
If I were to do it with the bare minimum,
mv
andbash
I would go with a for-loop andbash
builtin BRE matching.Use
rename
:Remove the
-n
if your happy with the output.For explanation, visit this.
Another option:
$ qmv {pattern}
will drop 2 columns of filenames into your editor of choice.
Modify the right column to have the filenames you want.
The left column is the original name. The start column of the right group cannot be changed, so auto-wrap may get in the way.
In the hands of an expert with each editor, this can be crazy fast, especially for vim column and visual modes.
In general, I use rename, but for complex needs, seeing the exact names in the editor is nice.