Keep 5 most recent files in a directory
One can keep the most recent n files in a directory with just three shell programs: ls
, tail
, and xargs
.
Here is an example to use in a nightly database backup cron job:
Tweet
One can keep the most recent n files in a directory with just three shell programs: ls
, tail
, and xargs
.
Here is an example to use in a nightly database backup cron job:
Tweet