Score:0

grep base on specific date

cn flag

I have a file somewhere on my linux hard drive which I know was created in November, 2007. I have tried find and grep . Nov ?? 2007 in MANY combinations with no success. What am I missing?

vanadium avatar
cn flag
Not sure unless you provide info on all you tried. `find` can retrieve files created between specified dates, so with only find, you can list all files of november 2007.
KneadToKnow avatar
us flag
You don't specify what syntax you used with find. Look at the accepted answer for this question (https://serverfault.com/questions/122824/linux-using-find-to-locate-files-older-than-date) , then look at the additional comments which use the '!' to negate the -newer switch on find.
Score:5
hr flag

You're possibly confusing shell globs (where ? matches any single character) with grep regular expressions (where ? is either literal, or a quantifier - while . matches any single character).

Regardless, grep isn't the right tool for this - you can specify a file modification date range to GNU find using -newermt:

find path/to/drive/ -type f -newermt '2007-10-31' ! -newermt '2007-12-01'
hr flag
@Rogo AFAIK it's normal for things like `~/.dbus` and `~/.gvfs` to only be accessible to their owner - I suspect you would have seen those permission errors eventually **without** excluding some directories, you're likely just encountering them sooner since `find` is now searching fewer places
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.