4 replies
June 2018

jeffgrigg

I might use sed for that: Generate the "mv" commands, and then execute them.

(Actually, most often, I use vim.)

1 reply
July 2018 ▶ jeffgrigg

jbrains

I typically find it handy to know various ways to do these kinds of tasks, since I never know which option might work best in a given situation. Thanks.

February 2020

disqus_koQEOG8NJ2

Maybe you could also elaborate a bit on how the parenthesis notation of zmv works together with the parenthesis notation in filename generation. For instance, to include hidden files in a pattern, I might use something like *rc(D) (all files ending in 'rc', including those starting with a dot). According to which rule does zmv know that this (D) is not meant as a pattern undergoing replacement?

1 reply
February 2020 ▶ disqus_koQEOG8NJ2

jbrains

I don't know. That sounds like the kind of thing that needs some exploring and an explaining article. These days, I use ranger and its bulkrename feature, which lets me rename a collection of files using a text editor, so I don't need zmv and its cousins like I did when I wrote this article.