Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
zmv '([0-9]*)' '1$1'

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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