[kwlug-disc] bulk renaming with regex

CrankyOldBugger crankyoldbugger at gmail.com
Wed Sep 28 20:16:17 EDT 2022


I can't live without 'rename', which is available for Ubuntu, but I don't
think the Red Hat/Fedora program of the same name is the same thing.

The Ubuntu version is easy enough to install:  "sudo apt install rename"

The syntax is

rename -v 's/regex/newnames/' *

Or some such variation.  With regex it's actually very flexible.  So in the
case of your files, you'd do:

rename -v 's/\ -\ s01e/\ -\ s02e/' *

(assuming you wanted to change the s01 to s02)



On Wed, Sep 28, 2022 at 7:54 PM Charles M <chaslinux at gmail.com> wrote:

> I have a bunch of videos I've ripped from my media and I'd like to
> automate renaming of them. Xubuntu has a bulk renaming tool that will
> let me rename the first part of the file. I'm wondering if there's a
> simple regex that would work for renaming the second part (episodes).
>
> For example: I have a show that's the second season:
>
> showname - s01e01
> showname - s01e02
> showname - s01e03
>
> (Where s is season and e is episode)
>
> Does anyone use Xubuntu's bulk renaming tool to do something similar?
>
> Thanks,
>
> Charles
>
> _______________________________________________
> kwlug-disc mailing list
> kwlug-disc at kwlug.org
> https://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20220928/24477b0e/attachment.htm>


More information about the kwlug-disc mailing list