Para renomear todos, exceto os arquivos 6, 8, 16, 19 e 28, se houver 30 arquivos no total:
$ rename -n 's/Magi The Labyrinth Of Magic Episode ([^68][^689]?|18|26|29) .+mp4/MTLOM (DUB) .mp4/g' *
rename(Magi The Labyrinth Of Magic Episode 10 English Dubbed.mp4, MTLOM (DUB) 10.mp4)
rename(Magi The Labyrinth Of Magic Episode 11 English Dubbed.mp4, MTLOM (DUB) 11.mp4)
rename(Magi The Labyrinth Of Magic Episode 12 English Dubbed.mp4, MTLOM (DUB) 12.mp4)
rename(Magi The Labyrinth Of Magic Episode 13 English Dubbed.mp4, MTLOM (DUB) 13.mp4)
rename(Magi The Labyrinth Of Magic Episode 14 English Dubbed.mp4, MTLOM (DUB) 14.mp4)
rename(Magi The Labyrinth Of Magic Episode 15 English Dubbed.mp4, MTLOM (DUB) 15.mp4)
rename(Magi The Labyrinth Of Magic Episode 17 English Dubbed.mp4, MTLOM (DUB) 17.mp4)
rename(Magi The Labyrinth Of Magic Episode 18 English Dubbed.mp4, MTLOM (DUB) 18.mp4)
rename(Magi The Labyrinth Of Magic Episode 1 English Dubbed.mp4, MTLOM (DUB) 1.mp4)
rename(Magi The Labyrinth Of Magic Episode 20 English Dubbed.mp4, MTLOM (DUB) 20.mp4)
rename(Magi The Labyrinth Of Magic Episode 21 English Dubbed.mp4, MTLOM (DUB) 21.mp4)
rename(Magi The Labyrinth Of Magic Episode 22 English Dubbed.mp4, MTLOM (DUB) 22.mp4)
rename(Magi The Labyrinth Of Magic Episode 23 English Dubbed.mp4, MTLOM (DUB) 23.mp4)
rename(Magi The Labyrinth Of Magic Episode 24 English Dubbed.mp4, MTLOM (DUB) 24.mp4)
rename(Magi The Labyrinth Of Magic Episode 25 English Dubbed.mp4, MTLOM (DUB) 25.mp4)
rename(Magi The Labyrinth Of Magic Episode 26 English Dubbed.mp4, MTLOM (DUB) 26.mp4)
rename(Magi The Labyrinth Of Magic Episode 27 English Dubbed.mp4, MTLOM (DUB) 27.mp4)
rename(Magi The Labyrinth Of Magic Episode 29 English Dubbed.mp4, MTLOM (DUB) 29.mp4)
rename(Magi The Labyrinth Of Magic Episode 2 English Dubbed.mp4, MTLOM (DUB) 2.mp4)
rename(Magi The Labyrinth Of Magic Episode 30 English Dubbed.mp4, MTLOM (DUB) 30.mp4)
rename(Magi The Labyrinth Of Magic Episode 3 English Dubbed.mp4, MTLOM (DUB) 3.mp4)
rename(Magi The Labyrinth Of Magic Episode 4 English Dubbed.mp4, MTLOM (DUB) 4.mp4)
rename(Magi The Labyrinth Of Magic Episode 5 English Dubbed.mp4, MTLOM (DUB) 5.mp4)
rename(Magi The Labyrinth Of Magic Episode 7 English Dubbed.mp4, MTLOM (DUB) 7.mp4)
rename(Magi The Labyrinth Of Magic Episode 9 English Dubbed.mp4, MTLOM (DUB) 9.mp4)
Usando ()
para salvar o padrão e para referenciá-lo. Não tenho certeza do que você quer que aconteça com o
0*
no seu substituto - acabei de retirá-lo. Ajuste conforme desejado.
Eu tirei as fugas desnecessárias
Nota sobre o regex
- [^68][^689]?|18|26|29
corresponde a qualquer caractere, mas 6
ou 8
é seguido opcionalmente por qualquer caractere, mas 6
, 8
ou 9
ou, corresponde a 18
ou corresponde a 26
ou corresponde a 29
. Não é muito elegante ...