Re: filter files In article <42862645.0404010543.235d8171@posting.google.com >, Steve Nottingham wrote:
> "MadUNIX" <madunix@web.de> wrote in message news:<c4ghok$2hcihp$1@ID-172702.news.uni-berlin.de>...
>> How can I remove files in directory which older than 2 days?
>>
>> How can I list files in a direcory which changed last 2 days?
>>
>> Thanks
>
> find is your friend.
>
> "find . -mtime +2 -exec rm{} \;" will delete files over 48 hours old,
> you might want to run "find -mtime +2 -ls" first, just to be sure.
>
> "find . -mtime -2 -ls" will list files changed in the last 48 hours.
>
> Steve
it is faster to do
find . -mtime +2 -print | xargs rm |