Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • give it a little more thought: which columns are you interested in comparing? do you know what the awk "logical and" operator is? do you know how to compare two strings? Commented Sep 20, 2016 at 15:23
  • Thanks for your quickest response. I would like to compare column 8 and 10 and if both are having year 2012 or prior, then i need those lines listed into a new file. if any one of them is greater than 2012, then i don't need it. I'm not aware of "logical and" operator as i'm not familiar with awk that much. Commented Sep 20, 2016 at 15:38
  • To help any readers that come in the future, you should add your answer below. Commented Sep 20, 2016 at 16:17
  • Why would ever want a logical AND between a condition on accessed and modified date? An entry will fail your test if it has been modified more recently than 2012 or if it has been accessed more recently. What's the use? If a file is modified, it is usually accessed: you're not going to have a file modified in 2016 that was last accessed in 2012. Or, rather, if you do, it's only because the filesystem is mounted such that access times are not being updated (e.g "noatime" mount option on Linux). In which case, access times are a fairly useless thing to evaluate. Commented Sep 20, 2016 at 21:29