I have a directory of files with similar names, but with incrementing digits as a suffix. I want to remove the lower suffixed files and only keep the files with the highest suffix. Below is an example file listing:
1k_02.txt 1k_03.txt 1l_02.txt 1l_03.txt 1l_04.txt 2a_05.txt 2a_06.txt 4c_03.txt 4c_04.txt
The above list needs to be reduced to the files below:
1k_03.txt 1l_04.txt 2a_06.txt 4c_04.txt
I don't even know where to start with this, but if possible I would like a single bash command.