[kwlug-disc] bulk renaming with regex

CrankyOldBugger crankyoldbugger at gmail.com
Thu Sep 29 13:25:20 EDT 2022


Sorry, I neglected to mention dry run mode.. very handy, that.  Take it
from a guy who's completely bahookee'd entire folders...


On Thu, Sep 29, 2022 at 1:18 PM Khalid Baheyeldin <kb at 2bits.com> wrote:

> Just like Doug and Steve, I am in the camp of "create a shell script,
> edit, then run it" camp.
>
> It often starts with awk:
>
> ls *show* | awk '{print "mv ", $1, $1}' > x
>
> Now x has a skeleton like:
>
> mv show1 show1
> mv show2 show2
>
> Then I edit using vim according to what I want (tedious part), then run
> it.
>
> But now that rename has been pointed out, I think I will try to use that
> instead.
> For one thing, it has -v (shows what is being done), and -n (a dry run
> mode), which
> should assist significantly with the task of renaming.
>
> _______________________________________________
> 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/20220929/aa0834d8/attachment.htm>


More information about the kwlug-disc mailing list