Skip to content

Instantly share code, notes, and snippets.

@bashkirtsevich
Created April 12, 2021 09:04
Show Gist options
  • Save bashkirtsevich/9f863adf0d3ad2daffa1cc4a746fca75 to your computer and use it in GitHub Desktop.
Save bashkirtsevich/9f863adf0d3ad2daffa1cc4a746fca75 to your computer and use it in GitHub Desktop.
Delete old logs

Delete all files:

find /var/log -type f -delete

Delete all .gz and rotated file

find /var/log -type f -regex ".*\.gz$"
find /var/log -type f -regex ".*\.[0-9]$"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment