files

Find

# This will delete all the files in a directory (and below) that are size zero

find /tmp -size 0 -print0 |xargs -0 rm 

# Compress all .log files

find . -name "*.log" -print0 | xargs -0r gzip

# Delete files modified in the last numberOfDays

find /var/ossim/logs/* -type f -mtime +numberOfDays | xargs rm -f

# Get a list of all files last modified in 2013. Useful for passing to xargs or while loop

find . -printf "%TY %p\n" | grep ^2013