[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Comando para substituir nome arquivo sem perder a numeração



Olá,

  Estava me lembrando que algum tempo atrás, eu usava o filebot para renomear temporadas de séries...inclusive legendas.

  Veja aqui: http://www.filebot.net/

  Se não me engano, eu tinha ele no Debian 6...mas sendo java, deve rodar sem problemas.

[]s

Luís Cláudio A. Gama
Fones: TIM:  11-9 8452-4087   Res: 11-4602-3400
Skype: luisclaudiogama       http://luisgama.googlepages.com

br.linkedin.com/in/luisclaudiogama

|""""""""""""""""""""""""""""|\|_
|          Voto Distrital !        |||"'|""\__
|______________________|||_|____|)
!(@)'(@)""""*********!(@)(@)*****!(@)

Em 28 de maio de 2015 11:35, Henrique de Moraes Holschuh <hmh@debian.org> escreveu:
On Thu, May 28, 2015, at 07:25, Antonio Terceiro wrote:
> On Thu, May 28, 2015 at 02:05:59AM -0300, Carlos Donizete wrote:
> > [Hacchi Fansub]_Gintama_221-HD.mkv  [Hacchi Fansub]_Gintama_223-HD.mkv
> > [Hacchi Fansub]_Gintama_222-HD.mkv  [Hacchi Fansub]_Gintama_224-HD.mkv
> >
> > Qual o comando certo para deixa-los exemplo deste modo:
> >
> > coringao@debian:~/teste$ ls
> > Gintama_221.mkv  Gintama_223.mkv
> > Gintama_222.mkv  Gintama_224.mkv
>
> veja rename(1), pacote rename
>
> $ rename 's/.*_Gintama/Gintama/; s/-HD//' *.mkv

É bom conhecer também o 'mmv' (no pacote de mesmo nome), que pode ser
mais fácil de usar.  Ele usa glob ao invés de regex, e tem proteção
contra colisão (aborta com mensagem de erro sem fazer nenhuma alteração
se você tentar mover/copiar mais de um arquivo para o mesmo _novo_
nome).

mmv '*Gintama*-HD.mkv' 'Gintama#2.mkv'

O mmv não só renomeia, ele move (para outra filesystem), copia, cria
symlink ou hardlink, e até mesmo faz append do fonte no destino.

--
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique de Moraes Holschuh <hmh@debian.org>


--
To UNSUBSCRIBE, email to debian-user-portuguese-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: [🔎] 1432823742.56568.280493209.0AE41B1F@webmail.messagingengine.com" target="_blank">https://lists.debian.org/[🔎] 1432823742.56568.280493209.0AE41B1F@webmail.messagingengine.com



Reply to: