Skip to content

Instantly share code, notes, and snippets.

Created Feb 18, 2019
What would you like to do?
Simple file rotating (e.g. for backups)
# based on
# It will keep only latest 12 files
ls -1t /path/to/dir/* | tail -n +13 | xargs rm > /dev/null 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment