I'm somewhat hampered by my OpenVMS experience with this problem. I need a
script that will remove all but the latest five files in a folder. There is
only one file per day and I want to keep five days worth. OpenVMS had a
nice little flag on the dir command (/before=today-5) that I often used for
this kind of thing. I'm just not finding anything similar in Linux. I've
found how to sort files based on modified date (ls -ltr), but how can I use
that to remove the older files?
I didn't see anything useful in the rm man page.
VA Health Administration Center
redhat-list mailing list