Quantcast
Channel: Linux: using find to locate files older than - Server Fault
Browsing latest articles
Browse All 12 View Live

Answer by Thibault Richard for Linux: using find to locate files older than

If you search for files created before todayTODAYMIDNIGHT=$(date --date '1 day ago'+"%Y-%m-%d 23:59:59")find . -type f -not -newermt "$TODAYMIDNIGHT"

View Article


Answer by Ahmed for Linux: using find to locate files older than

i hope this will help you# find files modified last 2 daysfind <directory> -type f -mtime -2# find files modifies BEFORE last 2 days (add the negative char !)find <directory> -type f !...

View Article

Answer by mt21 for Linux: using find to locate files older than

find <dir> -mtime +20Is the correct answer to this question (find files modified before the last 20 days).

View Article

Answer by Muzaffar Mahmood for Linux: using find to locate files older than

find ! -newermt “<DATE>”like this:find ! -newermt “jan 01 2015”This will give you files older than 01-01-2015 in your current...

View Article

Answer by MortenSickel for Linux: using find to locate files older than

Just to add on - you may even use two newermt arguments to search in a time interval:find ! -newermt "apr 01 2007" -newermt "mar 01 2007" -lsto find all files from march 2007.

View Article


Answer by nEJC for Linux: using find to locate files older than

Not directly related to question, but might be interesting for some that stumble here.find command doesn't directly support -older parameter for finding files older than some required date, but you can...

View Article

Answer by markus_b for Linux: using find to locate files older than

find <dir> -mtime -20this find command will find files modified within the last 20 days.mtime -> modified (atime=accessed, ctime=created)-20 -> lesst than 20 days old (20 exactly 20 days,...

View Article

Answer by user37841 for Linux: using find to locate files older than

if your date is formatted such that its ok for comparison, mydate=201003160120find . -type f -printf "%AY%Am%Ad%AH%AM%AS/:%p\n" | awk -vd="$mydate" -F'/:''$1 > d{ print $2 }'

View Article


Answer by Richard Holloway for Linux: using find to locate files older than

You could use a script like this#!/bin/bashif [ $# -ne 1 ];then when="today"else when=` date -d "$1"+"%s" `finow=`date +"%s"`seconds=`echo "$when - $now" | bc`minutes=`echo "$seconds / 60 " | bc `find...

View Article


Answer by Krzysztof Krasoń for Linux: using find to locate files older than

If you have only '-newer file' then you can use this workaround:# create 'some_file' having a creation date of 16 Mar 2010:touch -t 201003160120 some_file# find all files created after this datefind ....

View Article

Answer by Dennis Williamson for Linux: using find to locate files older than

No, you can use a date/time string.From man find:-newerXY reference Compares the timestamp of the current file with reference. The reference argument is normally the name of a file (and one of its...

View Article

Linux: using find to locate files older than

find has good support for finding files the more modified less than X days ago, but how can I use find to locate all files modified before a certain date?I can't find anything in the find man page to...

View Article
Browsing latest articles
Browse All 12 View Live