I am using Ubuntu and I have lots of files. The files have two types.
"img_00000_c0_1283347740957299us.jpg"
"img_00000_c1_1283347740342342us.jpg"
They are distinguished by c0 or c1. The numbers in the position '00000' increase as the file number goes up. For example, type c0 and 5th file would have name "img_00005_c0_1283347740957299us.jpg". The problem is, the long numbers after 'c0_' or 'c1_' is meaningless to me and they are random numbers. They are not always '1283347740957299us'. Therefore I want to rename those files just eliminating those last numbers.
img_00005_c1_1283347740957299us.jpg ---> img_00005_c1.jpg
I tried several answers in the Internet. For example, an answer like
for FILE in eventDataLog.txt.2015*; do mv "$FILE" "abc-$FILE"; done
I guess the code above from this answer would help me, but for my case, the renaming is not adding characters. I also found some answers about subtracting parts of the name in here, but my case has random numbers.
Thanks in advance!