4

I have a directory with files named like 19.png, 20.jpeg, and README00.txt

I want to rename these to 119.png, 120.jpeg, and README00.txt.

I would like to do this with zmv as it works well in so many other cases, but I cannot get zmv to make an action based on the first character of a filename being a digit. I can easily get 1README00.txt, but that is not what I desire.

1
4
zmv '([0-9]*)' '1$1'

This adds a 1 in front of a filename which starts with a digit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.