Last active
October 22, 2019 06:25
-
-
Save jewei/f22c752bb480f8cf06bbe6984dbf3bfa to your computer and use it in GitHub Desktop.
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
// Clear or truncate log files | |
truncate -s 0 /var/log/*.log | |
truncate -s 0 /var/log/**/*.log | |
find /var/log -type f -name '*.log' -exec truncate -s 0 {} + | |
find /var/log -type f -iname '*.log' -print0 | xargs -0 truncate -s0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment