我有几千个这样命名的文件:
Cyprinus_carpio_600_nanopore_trim_reads.fasta
Cyprinus_carpio_700_nanopore_trim_reads.fasta
Cyprinus_carpio_800_nanopore_trim_reads.fasta
Cyprinus_carpio_900_nanopore_trim_reads.fasta
Vibrio_cholerae_3900_nanopore_trim_reads.fasta
针对第一二个单词80种不同的变体(即80个不同的物种),我希望将这些文件都重命名,使得文件编号增加100 - 例如:
Vibrio_cholerae_3900_nanopore_trim_reads.fasta
would become
Vibrio_cholerae_4000_nanopore_trim_reads.fasta
或者
Cyprinus_carpio_300_nanopore_trim_reads.fasta
would become
Cyprinus_carpio_400_nanopore_trim_reads.fasta
很不幸,我无法弄清如何重命名它们,我试图遵循https://unix.stackexchange.com/questions/40523/rename-files-by-incrementing-a-number-within-the-filename上的解决方案,有些成功。
但是我无法使其在文件名内部起作用,如果这有所帮助,我正在运行Ubuntu 18.04。