1

So, I understand the difference between the three ideas in the title.

  1. atime -- access time = last time file opened

  2. mtime -- modified time = last time file contents was modified

  3. ctime -- changed time = last time file inode was modified

So, presumably when I type something like

find ~/Documents -name '*.py' -type f -mtime 14

will find all match all files ending with .py which were modified in the last 2 weeks. Nothing shows up...

So I try

find ~/Documents -name '*.py' -type f -atime 1400

which should match anything opened within the last 1400 days (ending with .py and having type file) and still nothing.

Am I misunderstanding the documentation? Does it mean exactly 1400 days, for example?

A relevant post:

find's mtime and ctime options

3

Yes, -mtime 14 means exactly 14. See the top of that section in the GNU find manual (labelled "TESTS") where it says "Numeric arguments can be specified as [...]":

Numeric arguments can be specified as

+n     for greater than n,

-n     for less than n,

n      for exactly n.

Note that "less than" means "strictly less than", so -mtime -14 means "last modified at the current time of day, 13 days ago or less" and -mtime +14 means "last modified at the current time of day, 15 days ago or more".

|improve this answer|||||
0

find ~/Documents -name "*.py" -type f -mtime 14 - exactly 14 days ago

find ~/Documents -name "*.py" -type f -mtime +14 - more than 14 days ago

find ~/Documents -name "*.py" -type f -mtime -14 - less than 14 days ago

The rest in your statement seems to be correct.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.