I have hundreds fast.gz files, and they have the same format of file name:
5809029_GWU_DNA_269_L001_R1_001.fastq.gz
5809030_GWU_DNA_269_L001_R1_001.fastq.gz
How do I change the first and the second underscores to dots? eg:
5809029.GWU.DNA_269_L001_R1_001.fastq.gz
5809030.GWU.DNA_269_L001_R1_001.fastq.gz
without changing the remaining underscores?
I have tried rename 's/_GWU_DNA/\.GWU\.DNA/' *gz
, it didn't change anything. So I'm thinking about a for loop, any idea? Thank you!
rename
is part of the system, or if it is, how it behaves, so I don't know if you have to install something, sorry. – schrodingerscatcuriosity Dec 03 '19 at 16:59GNU bash, versión 4.4.19(1)
– schrodingerscatcuriosity Dec 03 '19 at 17:03rename
utility by default, so if you have one, it must have been installed separately. There are different variations of this command though. – Kusalananda Dec 03 '19 at 17:24