Last active
May 24, 2018 09:57
-
-
Save zero-master/e726d0c8be5d002561c41fa7fdb90070 to your computer and use it in GitHub Desktop.
Truncate all log files in a directory
This file contains hidden or 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
#!/bin/bash | |
# Dry run | |
find . -type f -name "*.log" -exec echo {} \; | |
find . -type f -name "*.log" -exec truncate -s 0 {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment