[kwlug-disc] bulk renaming with regex
Khalid Baheyeldin
kb at 2bits.com
Thu Sep 29 13:17:55 EDT 2022
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20220929/2f0c7d86/attachment.htm>
More information about the kwlug-disc
mailing list