Joined February 2015
·

David White

Newcastle-under-Lyme
·
·
·

Posted to Remove files older than 7 days over 1 year ago

Surely it would be more concise to use find's modification or creation time functions:

find DIRECTORY -type f -and \( -size 0 -or -mtime +7 \) -exec rm {} \;

This will remove only files (not directories) that are older than 7 days

Achievements
1 Karma
0 Total ProTip Views
Interests & Skills