0

I have thousands files in format randomstring_XXXXXXXX.jpg where 'xxx' is unixtime (1388415305). Now I need to delete all files older than some (unixtime) date.

Does anyone have a solution for this?

1 Answer 1

0

Perl solution (untested):

perl -e 'unlink grep { ($d) = /_([0-9]+)\.jpg/ and $d < XXXXXX } glob "*_*.jpg"'
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .