On Feb 2, 2008 5:00 PM, Kristian Erik Hermansen wrote:
> > I would like to keep the last N files. Let's say 5.
>
> Delete all files created more than 5 days ago?
> $ find /path/to/logs -ctime +5 -type f -exec rm -f {} \;
I know how to use find/xargs to delete files by timestamp.
What I want to do is to delete anything over the last N files.