RC Logr 20190213 103149
Wednesday, 13 Feb, 2019
Today I easily renamed a large number of text files in nested folders with the zsh
built-in zmv
(man page in zshcontrib). Load it with autoload -U zmv
. I ran it with -n
to force a dry run until I got the regex right, and the final was: zmv -Q '(**/)(*).txt' '$1$2.md'
(zmv -opt searchstring replace string
) where -Q
renames hidden files also, the parentheses around the search path and filename globs will put those in sub-expression variables, and the variables are then referred to as $1 and $2 in the replace string.