Trick of today: find -daystart

What to get the files older than today? Run

    find /path/ -type f -daystart -mtime +0

it will return only the files older than today, no matter the time the command is executed (by default, -mtime counts multiples of 24 hours from now). Kinda nice when you want to archive yesterday log files.

No comments: