V
V
Vitaly Melnikov2019-11-04 00:31:15
bash
Vitaly Melnikov, 2019-11-04 00:31:15

How to rename several files using a mask in the console?

It is necessary to recursively rename files according to the mask *-en.srt -> *.srt (spaces are allowed in the name)
It's easy with one file if I set the name: I can't understand all at once. I think something should be written with a cycle, but there is not enough knowledge in bash.
mv "first subtitle-en.srt" "first subtitle.srt"

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Moseychuk, 2019-11-04
@Vmelnikoff

rename "-en.srt" ".srt" *-en.srt

S
SOTVM, 2019-11-04
@sotvm

rename 's/-en.srt$/\.srt/' *-en.srt

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question