Take the 2-minute tour ×  What's a Unix/Linux one-liner that
will let me delete all but the most recent N revisions of each
file?  I've got a bunch of files with revision numbers as part
of a legacy asset-management system:   I want to keep the last
three of each, so in the above list the command would delete
bar.r7.js, bar.r8.js and foo.r1.js.  share|improve this question
Perhaps it's time to learn how to use version control software.
–  Ignacio Vazquez-Abrams Mar 31 '11 at 17:44 There's a reason I
said "legacy asset-management system." Legacy as in I can't
change it. –  a paid nerd Mar 31 '11 at 17:51 Have someone else
change it, then. There's a limit at how much old cruft a company
can use. It's for your own sanity!@ –  grawity Mar 31 '11 at
20:48 @grawity Thanks. Yes, I've got a new thing in place, but
this is for cleaning up constantly-generated revision from the
old thing, and I suspected that someone might enjoy the mental
exercise. –  a paid nerd Mar 31 '11 at 22:47 add comment  1
Answer  up vote 1 do