F
F
Freud's cat2019-05-04 20:14:35
linux
Freud's cat, 2019-05-04 20:14:35

How to rename a bunch of files by mask?

There is a directory with over 9000 png images whose name matches the mask 'xxx-yyy-zzz.png'
You need to rename them so that the name matches the mask 'xxx.png'.
How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2019-05-04
@medbrat69

rename 's/(.*?)-.*\.png/$1.png/' *.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question