How to rename files in bash to increase number in name?

后端 未结 4 1084
鱼传尺愫
鱼传尺愫 2021-01-07 02:20

I have a few thousand files named as follows:

Cyprinus_carpio_600_nanopore_trim_reads.fasta                
Cyprinus_carpio_700_nanopore_trim_reads.fasta             


        
4条回答
  •  星月不相逢
    2021-01-07 03:06

    Mark's perl-rename solution looks great but you should apply it twice with a bump of 50 to avoid name conflict. If you can't find this flavor of rename you could try my rene.py (https://rene-file-renamer.sourceforge.io) for which the command would be (also applied twice) rene *_*_*_* *_*_?_* B/50. rene would be a little easier because it automatically shows you the changes and asks whether you want to make them and it has an undo if you change your mind.

提交回复
热议问题