I have a list of files (say xsl format below) in one directory. I want to keep the last two version of all files. (I can delete the remaing files){A}_1.0.xsl{A}_2.0.xsl{A}_3.0.xsl{A}_4.1.xsl{A}_5.0.xsl{A}_6.0.xsl{B}_1.0.xsl{B}_2.0.xsl{B}_3.0.xsl{B}_4.0.xsl{C}_1.0.xsl{C}_2.0.xsl{C}_3.0.xslThe remaining files present in the directory should be {A}_5.0.xsl{A}_6.0.xsl{B}_3.0.xsl{B}_4.0.xsl{C}_2.0.xsl{C}_3.0.xslHow can it be achieved?
Keeping the latest two version and delete the remaining
bash;filenames;ksh;rm