This should work
find . -type f -mtime -3
Explanation
find find files
. starting in the current directory (and it's subdirectories)
-type f which are plain files (not directories, or devices etc)
-mtime -3 modified less than 3 days ago
See man find
for details
Update
To find files last modified before a specific date and time (e.g. 08:15 on 20th February 2013) you can do something like
touch -t 201302200815 freds_accident
find . -type f ! -newer freds_accident
rm freds_accident
See man touch
(or info touch
- ugh!)
This is moderately horrible and there may be a better way. The above approach works on ancient and non-GNU Unix as well as current Linux.
Red, just a curiosity, I'm reading the man find now, and I would like to list files older than today only,
daystart
it seems the right choice, but how do I pass thestart
date ? – Valter Silva – 2013-03-04T13:58:18.230@Valter: the
-daystart
option uses today's date. At 08:00 on 4th March,find -mtime +3
finds files modified longer ago than 08:00 1st March. I thinkfind -daytime -mtime +3
should find files modified longer ago than 00:00 1st March. – RedGrittyBrick – 2013-03-04T14:08:50.327Typo in prior comment: s/daytime/daystart/. Also see update in answer. – RedGrittyBrick – 2013-03-04T14:24:03.160