-2

Please I need to find all files before 1/1/2017 and delete them on Linux platform

I have searched and found this find ./ -type f -mtime -exec rm -rf {} \; so how to specify the above date

Hisham Rakha
  • 17
  • 2
  • 8
  • https://stackoverflow.com/questions/33091013/delete-files-older-than-specific-date-in-linux – Dhanushka Dolapihilla Jul 04 '18 at 09:49
  • 2
    Possible duplicate of [Delete files older than specific date in linux](https://stackoverflow.com/questions/33091013/delete-files-older-than-specific-date-in-linux) – Dhanushka Dolapihilla Jul 04 '18 at 09:50
  • Too late. That was more than a year ago. – Kusalananda Jul 04 '18 at 09:58
  • Please avoid *"Give me the codez"* questions that have been asked and answered so many times you have to make an effort to avoid finding an answer. Also see [How much research effort is expected of Stack Overflow users?](https://meta.stackoverflow.com/q/261592/608639) – jww Jul 05 '18 at 12:03

1 Answers1

-1

I hope these commands help

touch -d "2010-11-21 23:59:59" /tmp/date.start;
touch -d "2010-11-23 00:00:00" /tmp/date.end;
find ./ -type f -newer /tmp/date.start ! -newer /tmp/date.end -exec rm {} \;