I have files with the following names:
1_shahlirtsb_p.mp3_103899.mp3
2_shahlirtsb_p.mp3_103898.mp3
3_shahlirtsb_p.mp3_103897.mp3
4_shahlirtsb_p.mp3_103896.mp3
5_shahlirtsb_p.mp3_103895.mp3
6_shahlirtsb_p.mp3_103894.mp3
7_shahlirtsb_p.mp3_103893.mp3
How can I rename them from the command line (using regular expression) to 1_shahlir.mp3
, 2_shahlir.mp3
,and so on...
for i in *mp3; do mv $i ${i/.mp3*/.mp3}; done