Use perl-rename
. This is usually called rename
on DebainDebian-based systems like Ubuntu or Mint, and perl-rename
or prename
on others. Assuming you have it as rename
, you can simply do:
rename -n 's/.*\.vcf/"A" . ++$c . ".vcf"/e' *snp.pass.vcf
The -n
causes rename
to only print what it would do, without doing anything. So once you make sure it does what you want, run the command again without the -n
.