Created
July 14, 2011 18:11
-
-
Save jwood/1083024 to your computer and use it in GitHub Desktop.
Script to clear out log files in development project directores
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
#!/bin/bash | |
dev_dir=/Users/jwood/dev | |
for d in `ls $dev_dir`; do | |
test -d $dev_dir/$d/log | |
if [ $? -eq 0 ]; then | |
for f in `ls $dev_dir/$d/log/*.log`; do | |
> $f | |
done | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you're anything like me, your disk space slowly gets eaten away by log files. This script will clear out all of the log files in the "log" directory of your projects.