Skip to content

Instantly share code, notes, and snippets.

@jwood
Created July 14, 2011 18:11
Show Gist options
  • Save jwood/1083024 to your computer and use it in GitHub Desktop.
Save jwood/1083024 to your computer and use it in GitHub Desktop.
Script to clear out log files in development project directores
#!/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
@jwood
Copy link
Author

jwood commented Jul 14, 2011

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.

@raykrueger
Copy link

Nice, I dig it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment