4 ms·
I like that idea of converting metadata to text, so you can do text operations on it that you are already familiar with, and then apply the changes back. If yo
by Erwin 4y ago
I like that idea of converting metadata to text, so you can do text operations on it that you are already familiar with, and then apply the changes back.
If your problem can be solved by just regexps, there's a "rename" tool installed by Perl I've used for decades. E.g.
rename -n 's/JPEG$/jpg/' *JPEG
Will apply the substitution for JPEG at end of the filename to just jpg. The -n will run without renaming so you can see what it intends to do.
- greazy 4y agoA newer tool 'brename' is similar but uses standard inputs and allows for full regex. Like rename it has dry mode for safe renaming.
- jwilk 4y agoBeware there are two incompatible rename programs in the wild. :( What you have installed, and what Debian and its derivates ship is this: https://metacpan.org/pod/distribution/File-Rename/rename.PL https://metacpan.org/pod/distribution/File-Rename/rename.PL Most(?) other distros ship the one from util-linux: http://man7.org/linux/man-pages/man1/rename.1.html http://man7.org/linux/man-pages/man1/rename.1.html
- ChrisGranger 4y agoWe had the same idea at the same time. For a command line newbie trying to follow a tutorial, it can certainly be confusing.
- ChrisGranger 4y agoNote that the rename tool bundled with some distributions is not the Perl version. If someone is looking to install it, it may also be called perl-rename.