News for hackers. Stuff that matters.
Re:New(ish) command line tools by Erwin on Wednesday April 13, 2022 @05:01AM (#31012519)
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.
Re:New(ish) command line tools by jwilk on Wednesday April 13, 2022 @10:19AM (#31014951)
Beware 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

Most(?) other distros ship the one from util-linux: http://man7.org/linux/man-pages/man1/rename.1.html

Re:New(ish) command line tools by ChrisGranger on Wednesday April 13, 2022 @10:22AM (#31014980)
We had the same idea at the same time. For a command line newbie trying to follow a tutorial, it can certainly be confusing.
Re:New(ish) command line tools by greazy on Wednesday April 13, 2022 @05:04AM (#31012534)
A newer tool 'brename' is similar but uses standard inputs and allows for full regex. Like rename it has dry mode for safe renaming.
Re:New(ish) command line tools by ChrisGranger on Wednesday April 13, 2022 @10:20AM (#31014957)
Note 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.