Skip to content

Instantly share code, notes, and snippets.

@SethosII
Last active July 29, 2017 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SethosII/c99d75de929007b8c09012be12df663f to your computer and use it in GitHub Desktop.
Save SethosII/c99d75de929007b8c09012be12df663f to your computer and use it in GitHub Desktop.
Ansible has the option to create backup files when something is changed. All of them have a suffix with the same structure.
# the regex is basically everything ending with: .arbitrarynumber.YYYY-MM-DD@hh:mm:ss~
sudo find / -regextype egrep -regex '.*.[0-9]*.[0-9]{4}-[0-9]{2}-[0-9]{2}@[0-9]{2}:[0-9]{2}:[0-9]{2}~' | xargs -n 1 rm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment