I gothave a bunch of files that iI have to process, the on a Linux machine. The files look like this:
2009-08-18T034353_DR1_4N-NAC_123456_1234_band1.ntf
2009-08-18T034353_DR1_4N-NAC_123456_1234_browse.jpg
2009-08-18T034353_DR1_4N-NAC_123456_1234_band2.ntf
2009-08-18T034353_DR1_4N-NAC_123456_1234_license.txt
2009-08-18T034353_DR1_4N-NAC_123456_1234_metadata.xml
2009-08-18T034353_DR1_4N-NAC_123456_1234_readme.txt
2009-08-18T034353_DR1_4N-NAC_123456_1234_udm.tif
2009-08-18T034353_DR1_4N-NAC_123456_1234_band1.ntf 2009-08-18T034353_DR1_4N-NAC_123456_1234_browse.jpg 2009-08-18T034353_DR1_4N-NAC_123456_1234_band2.ntf 2009-08-18T034353_DR1_4N-NAC_123456_1234_license.txt 2009-08-18T034353_DR1_4N-NAC_123456_1234_metadata.xml 2009-08-18T034353_DR1_4N-NAC_123456_1234_readme.txt 2009-08-18T034353_DR1_4N-NAC_123456_1234_udm.tif I want to delete this part: "-NAC_123456_1234"-NAC_123456_1234 where the first part can consist of alphanumeric characters and the number parts only of numeric characters.
I tried to a rename command but i wontcouldn't get it to work,. I thought of something like:
rename '/-[a-zA-Z]+_[0-9]+_[0-9]+//' *.*
rename '/-[a-zA-Z]+_[0-9]+_[0-9]+//' *.* Someone canCan someone help me with what iI am missing? My
My rename version is: rename from util-linux 2.23.2
rename from util-linux 2.23.2