Created
November 17, 2020 14:09
-
-
Save damianobarbati/2c0a7db4880160b805d3a7c87f2c49ff to your computer and use it in GitHub Desktop.
find + rm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find /var/log/ -maxdepth 1 -type f -iwholename '*[^a-z0-9\-\_\.\/]*' -print0 | xargs -r -0 rm | |
find /var/log/ -maxdepth 1 -type f -not -iname '*_*' -print0 | xargs -r -0 rm | |
find /var/log/ -maxdepth 1 -type f -not -name '*_*.log*' -delete | |
find /var/log/ -maxdepth 1 -type f -name '*.php*' -delete | |
find /var/log/ -maxdepth 1 -type f -name '*.html*' -delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment